Answered step by step
Verified Expert Solution
Question
1 Approved Answer
3) Given the following pseudo code, write the python program? You program accepts number and doubles it and displays the result. Tis happens until you
3) Given the following pseudo code, write the python program? You program accepts number and doubles it and displays the result. Tis happens until you enter a negative number once a negative number is entered the program exits. 10 marks for double the number and displaying the number 10 marks for making the while loop work as described in the problem Psuedo Code // Variables needed to hold input, intermediate values, and results // To quit enter a negative number Declare Integer numToDouble Declare Integer result // Prints out a blank line and instruction Display Display "Enter number would you like to double and press Enter." read from console Input num ToDouble // Start of loop and check for sentinel value While numToDouble>0 // Calculates and displays result Set result numToDouble 2 Display "2X ", numToDouble,"-",result // Prints out a blank line and instructiorn Display Display "Enter number would you like to double and press Enter.* // Reads next user input Input numToDouble End While //Quitting message Display "OK, you entered a value0, ending execution
Step 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