Question
input/output declare (name / space allocation) and initialize (assign value to) variables iteration (looping) selection (decision / IF-THEN) comments You must write a small program
- input/output
- declare (name / space allocation) and initialize (assign value to) variables
- iteration (looping)
- selection (decision / IF-THEN)
- comments
You must write a small program in Python that illustrates all FIVE of the above concepts.
To fulfill the "comments" concept, do the following:
- insert a comment at the top of your program that states the problem your code is solving.
- insert comments elsewhere in the code to point out to me where each of the other concepts is illustrated.
As an example, I have attached a small JAVA "gimme 5" program. HOWEVER, I expect you to come up with a more creative idea (similar in complexity to the Smart Cart last week) instead of just randomly using the constructs the way I have in the minimal Java program.
Some examples include: Play a "hi-lo" guessing game with the computer; break a simple "Caesar cipher"; implement a classic sorting algorithm like Bubble; determine if a string is a palindrome; convert a decimal number to another base of the user's choosing . . . get the idea???
The Evidence:
Submit the following:
- your source code in a form that I can read and cut/paste if I would like to run it myself
- a screenshot showing in a way that is obvious to me that your program has successfully run (that is, one reasonable test case)
-Must Be in Python Language
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started