Answered step by step
Verified Expert Solution
Question
1 Approved Answer
### I NEED HELP CODING THESE PROGRAMS WITH PYTHON (IDLE) THERE IS ALSO SPECIFICATIONS BELOW EACH PROGRAM THAT ARE REQUIRED Create a program that checks
### I NEED HELP CODING THESE PROGRAMS WITH PYTHON (IDLE) THERE IS ALSO SPECIFICATIONS BELOW EACH PROGRAM THAT ARE REQUIRED
Create a program that checks whether a number is a prime number and displays the total number of factors if it is not a prime number Console Prime Number Checker Please enter an integer between 1 and 5000: 1 Invalid integer. Please try again. Please enter an integer between 1 and 5000: 2 2 is a prime number Try again? (y): y Please enter an integer between 1 and 5000: 3 3 is a prime number Try again? (y): y Please enter an integer between 1 and 5000: 4 4 is NOT a prime number It has 3 factors Try again? (y): y Please enter an integer between 1 and 5000: 6 6 is NOT a prime number It has 4 factors Try again? (y): n Bye! Specifications A prime number is only divisible by two factors (1 and itself). For example, 7 is a prime number because it is only divisible by 1 and 7 If the number is not a prime number, the program should display its number of factors. For example, 6 has four factors (1, 2, 3, and 6) Store the code that gets a valid integer for this program in its own function Store the code that calculates the number of factors for a number in its own function. Store the rest of the code that gets input and displays output in the main function Create a program that uses a function to simulate the roll of a die Console Dice Roller Roll the dice? (y): y Die 1: 3 Die 2: 6 Total: 9 Roll again? (y): y Die 1: 1 Die 2: 1 Total: 2 Snake eyes! Roll again? (y): y Die 1: 6 Die 2: 6 Total: 12 Boxcars! Roll again? (y): n Specifications The program should roll two six-sided dice Store the code that rolls a single die in a function Store the code that gets input and displays output in the main function. Whenever it's helpful, use helper functions to split this code into other functions The program should display a special message for two ones (snake eyes) and two sixes (boxcars) Sales Tax Calculator ENTER ITEMS (ENTER 0 TO END) Cost of item: 35.99 Cost of item: 27.50 Cost of item: 19.59 Cost of item: 0 Total: Sales tax: Total after tax: 88.06 83.08 4.98 Again? (y): y ENTER ITEMS (ENTER 0 TO END) Cost of item: 152.50 Cost of item: 59.80 Cost of item: 0 Total: Sales tax: Total after tax: 225.04 212.3 12.74 Again? (y): n Thanks, bye! Specifications " The sales tax rate should be 6% of the total Store the sales tax rate in a module. This module should also contain functions that calculate the sales tax and the total after tax. These functions should round the results to a maximum of two decimal places. Store the code that gets input and displays output in another module. Divide this code into functions wherever you think it would make that code easier to read and maintain Assume the user will enter valid data Create a program that converts feet to meters and vice versa Console Feet and Meters Converter Conversions Menu: a. Feet to Meters b. Meters to Feet Select a conversion (a/b): a Enter feet: 100 30.48 meters Would you like to perform another conversion? (y): y Conversions Menu: a. Feet to Meters b. Meters to Feet Select a conversion (a/b): b Enter meters: 100 328.08 feet Would you like to perform another conversion? ():n Thanks, bye! Specifications The formula for converting feet to meters is: feet meters/0.3048 The formula for converting meters to feet is: meters feet*0.3048 Store the code that performs the conversions in functions within a module. For example, store the code that converts feet to meters in a function in a module Store the code that displays the title in its own function, and store the code that displays the menu in its own function, but store the rest of the code that gets input and displays output in a main function Assume the user will enter valid data The program should round results to a maximum of two decimal placesStep 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