Question: Convert the Do - while loop in the following code to a while loop: Declare String sure Do Display Are you sure you want to
Convert the Dowhile loop in the following code to a while loop:
Declare String sure
Do
Display "Are you sure you want to quit?"
Input sure
While sure Y AND sure Y
Convert the following while loop to a For loop:
Declare Integer count
While count
Display "The count is count
Set count count
End While
Convert the following For loop to a while loop:
Declare Integer count
For count To
Display count
End For Find the error in the following pseudocode.
Declare Boolean finished False
Declare Integer value, cube
While NOT finished
Display "Enter a value to be cubed."
Input value;
Set cube value
Display value, cubed is cube
End While
The programmer intended the following pseudocode to display the numbers
through and then display the message "Time's up It will not function as
intended, however. Find the error.
Declare Integer counter
Const Integer TIMELIMIT
While counter TIMELIMIT
Display counter
Set counter counter
End While
Display "Time's up The programmer intended the following pseudocode to get five sets of two
numbers each, calculate the sum of each set, and calculate the sum of all the
numbers entered. It will not function as intended, however. Find the error.
This program calculates the sum of five sets of two numbers.
Declare Integer number, sum, total
Declare Integer sets, numbers
Constant Integer MAXSETS
Constant Integer MAXNUMBERS
Set sum ;
Set total ;
For sets To MAXNUMBERS
For numbers TO MAXSETS
Display "Enter number numbers, of set sets,
Input number;
Set sum sum number
End For
Display "The sum of set sets, is sum,
Set total total sum
Set sum
End For
Display "The total of all the sets is total, "Algorithm Workbench
Design a while loop that lets the user enter a number. The number should be
multiplied by and the result stored in a variable named product. The loop
should iterate as long as product contains a value less than
Design a Dowhile loop that asks the user to enter two numbers. The numbers
should be added and the sum displayed. The loop should ask the user whether he
or she wishes to perform the operation again. If so the loop should repeat;
otherwise it should terminate.
Design a For loop that displays the following set of numbers:
dots,
Design a loop that asks the user to enter a number. The loop should iterate
times and keep a running total of the numbers entered.
Design a For loop that calculates the total of the following series of numbers:
dots
Design a nested loop that displays rows of # characters. There should be #
characters in each row.
Convert the while loop in the following code to a Dowhile loop:
Declare Integer
While
Display "Enter a number.
Input
End While
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
