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, 21.06.2019 16:20
Quincy would like to view the contents of a specific message in his inbox. a portion of his computer screen is shown. what should quincy do in order to complete this task? 1. click on the inbox in the navigation pane, and click on the specific message in the folder pane to display its contents. 2. click on the inbox in the outlook today window, and click on the specific message in the folder pane to display its contents. 3. double-click the message’s header in the outlook today window, and right-click on the specific message to display its contents. 4. double-click the mail option in the navigation pane, and right-click on the specific message to display its contents.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Which of these is most responsible for differences between the twentieth century to the twenty-first century?
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
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, 22.10.2020 22:01
question
English, 22.10.2020 22:01
Questions on the website: 13722360