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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!