Course Answers

BUSINESS
COMPUTER SCIENCE
OTHER COURSES
My Profile

Solved: Python 3.7 To Be Used. Just A Simple Design A Program That Depends On Its Own. You Should Also Not Need To Import Anything. No Code Outside Of A Function!

By |

Python 3.7 to be used. Just a simple design a program that depends on its own. You should also not need to import anything. No code outside of a function!

Menu Driven Application Design a program called IntFun.py which reads in a on-negative integer from the user. The user will tThcre must be crror chccking on the mcnu choicc entered: if the uscr cnters a choicc not on the mcnu, the program will printSAMPLE OUTPUT Welcome to Integer Fun. Please enter a non-negative integer --> -12 I am sorry that is not a non-negative integ3. Print the prime numbers betwccn 2 and thc intcgcr 4. Print the sum of the digits of the integer 5. Quit the program Choice4. Print the sum of the digits of the integer 5. Quit the program Choice 5 Thank you and have a nice day



Menu Driven Application Design a program called IntFun.py which reads in a on-negative integer from the user. The user will then be prompled with a menu of choices (this menu should be repeitively displayed until the user chooses to quit): You must implement #1 and #5 and # 2 #3,and #4. MENU Guest Check Your menu will include these choices 669918 1. Enter a new number 2. Print the number of odd digits, even digits and zeros in the integer 3. Print the prime numbers between 2 and the integer 4 Print the sum of the digits of the integer 5. Quit the program PROGRAM PARTICULARS: When the program starts up, ask the uscr for a non-ncgative intcger. After the user cnters the non-negative intcger, display the above menu. Remember the uscr can choose to do #1, #2, #3, #4 and # 5 on the samc numbcr. Mcanng once you havc the number from thc user do not make the uscr cnter a new number cach time. The uscr can kccp the same number until the user selccts option 1 (see example output below.) There must bc cITor chccking on the input integcr: if it is negative, the program will print an crror messagc and rc-prompt. This process will continuc until valid input is cntered. You may assume an integer of some form will be cntered by the user Thcre must be crror chccking on the mcnu choicc entered: if the uscr cnters a choicc not on the mcnu, the program will print an crror messagc, re-display the menu and rc-prompt. This process will continuc until valid input is entered No string variables are allowed. No built-in methods for integer manipulation are allowed. You may assume that no integer entered will be greater than the maximum integer size for type int HINTS: First, solve the primary problems one a a ime, testing ech one eparately (Make sure that your algorithm works for single-digit numbers ncluding ero!) Solve the input and error checking problems once the others are solved and tested SAMPLE OUTPUT Welcome to Integer Fun. Please enter a non-negative integer --> -12 I am sorry that is not a non-negative integer. Please enter a non-negative integer --> 120 Please select from the following menu choices. 1. Enter a new number 2. Print the number of odd, even and zero digits in the integer 3. Print the prime numbers between 2 and the integer 4. Print the sum of the digits of the integer 5. Quit the program Choice->6 I am sorry that is an invalid menu choice. Please try again Please select from the following menu choices 1. Enter a ncw number 2. Print the number of odd, even and zeros in the integer 3. Print the prime numbers betwcen 2 and the intcger 4. Print the sum of the digits of the integer 5. Quit the program Choice>2 Your results are odd even 1 zero(s) Please select from the following menu choices. 1. Enter a new number 2. Print the number of odd, even and zeros in the integer 3. Print the prime numbers betwccn 2 and thc intcgcr 4. Print the sum of the digits of the integer 5. Quit the program Choice 4 The sum of the digits in the number 120 is 3 Please select from the following menu choices. 1. Enter a new number 2. Print the number of odd, even and zeros in the integer Print the prime numbers between 2 and the integer 3. 4. Print the sum of the digits of the integer 5. Qui the program Choice 1 Please enter a non-negative integer --> 10 Please select from the following inenu choices. 1. Enter a ncw number 2. l'rint the number of odd, even and zeros in the integer 3. Print the prime numbers betwccn 2 and the intcgcr 4. Print the sum of the digits of the integer 5. Quit the program Choice 2 Your results are odd cven 0 zcro(s) Please select from the following menu choices. Enter a new number 1. 2. Print the number of odd, even and zeros in the integer Print the prine numbers between 2 and the integer 3. 4. Print the sum of the digits of the integer 5. Quit the program Choice 5 Thank you and have a nice day

Answer Preview

Below is the complete program as per the requirements. It is well explained inside the code using comments. # displays the menu def menu(): print('\nPlease select from the following menu choice

Get Answer Now


Buy (USD $9.00)

Get Answer Now

Answered
Buy @ USD $9.00
Related Questions

OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES
OTHER COURSES