subject

Three functions are required:get_input():This function takes no parameters, but will ask the user for an integer number. It will return a valid integer. You will use an indefinite loop and exception handling like we discussed in class. It is required to catch user input error and gracefully recover. Learn about the continue keyword and how it works in a loop; it can be handy. is_prime(n):This function will take an integer parameter n, and return True if the number is prime, or return False if it is not prime. You can use this pseudocode for primality testing to write this function. main():This does the bulk of your program’s work for solving Goldbach’s conjecture. You will call get_input() and is_prime(n) from main().Goldbach’s conjecture itself will be solved using an indefinite loop. Particularly a ‘post-test’ loop pattern. A for loop will not be accepted as part of the solution. OutputA successful run:This program tests the Goldbach's conjecturePlease enter an even integer larger than 2: 3636 = 5 + 31A run recovering from errors:This program tests the Goldbach's conjecturePlease enter an even integer larger than 2: 7Wrong input!Please enter an even integer larger than 2: fooBad input!Please enter an even integer larger than 2: 88 = 3 + 5If by chance the number chosen is valid, but doesn’t hold for Goldbach’s conjecture, then print:Goldbach's conjecture doesn't hold for [whatever the number is]

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:00
How can a user delete a drawing object
Answers: 1
question
Computers and Technology, 24.06.2019 11:30
Convert 11001110(acdd notation) into decimal
Answers: 2
question
Computers and Technology, 24.06.2019 16:30
The database design steps are listed below in the incorrect order. choose the correct order number next to each step. determine the information to be stored in the database. determine the fields needed to record the data determine if there will be any repetition of data entered, and separate the fields into tables to normalize the data. create relationships to connect the tables.
Answers: 3
question
Computers and Technology, 24.06.2019 17:30
Click on the tab on the ribbon to open the backstage view. file view insert review
Answers: 1
You know the right answer?
Three functions are required:get_input():This function takes no parameters, but will ask the user fo...
Questions
question
Mathematics, 26.12.2019 03:31
Questions on the website: 13722361