Question: Give me an example of Algorithm Workbench ? ( ) Design an If - Then statement ( or a flowchart with a single alternative decision

Give me an example of Algorithm Workbench ?()
Design an If-Then statement (or a flowchart with a single alternative decision
structure) that assigns 20 to the variable y and assigns 40 to the variable z if the
variable x is greater than 100.
Design an If-Then statement (or a flowchart with a single alternative decision
structure) that assigns 0 to the variable b and assigns 1 to the variable c if the
variable a is less than 10.
Design an If-Then-Else statement (or a flowchart with a dual alternative decision
structure) that assigns 0 to the variable b if the variable a is less than 10.
Otherwise, it should assign 99 to the variable b.
The following pseudocode contains several nested If-Then-Else statements.
Unfortunately, it was written without proper alignment and indentation. Rewrite the
code and use the proper conventions of alignment and indentation.
If score 60 Then
Display "Your grade is F."
Else
If score 70 Then
Display "Your grade is D."
Else
If score 80 Then
Display "Your grade is C."
Else
If score 90 Then
Display "Your grade is B."
Else Else
Display "Your grade is A."
End If
End If
End If
End If
Design nested decision structures that perform the following: If
is greater
than 10 and amount2 is less than 100, display the greater of amount1 and
amount2.
Rewrite the following If-Then-Else If statement as a select case statement.
If selection ==1 Then
Display "You selected A."
Else If selection ==2 Then
Display "You selected 2."
Else If selection ==3 Then
Display "You selected 3."
Else If selection ==4 Then
Display "You selected 4."
Else
Display "Not good with numbers, eh?"
End If
Design an If-Then-Else statement (or a flowchart with a dual alternative decision
structure) that displays "Speed is normal" if the speed variable is within the range
of 24 to 56. If speed holds a value outside this range, display "Speed is
abnormal." Design an If-Then-Else statement (or a flowchart with a dual alternative decision
structure) that determines whether the points variable is outside the range of 9 to
If the variable holds a value outside this range it should display "Invalid
points." Otherwise, it should display "Valid points."
Design a case structure that tests the month variable and does the following:
If the month variable is set to 1, it displays "January has 31 days."
If the variable is set to 2, it displays "February has 28 days."
If the month variable is set to 3, it displays "March has 31 days."
If the month variable is set to anything else, it displays "Invalid selection."
Write an If-Then statement that sets the variable hours to 10 when the flag
variable minimum is set.
TIPS ON HOW TO SOLVE:
1 Use x,y,z as variables
Wrte an if statement
Similar example:
If x60 Then
y=25
z=10
End if
2 Use a,b,c as variables
Wrte an if statement
Sample:
If a60 Then
b=25
c=10
End if
3 Use a,b as variables
Use an if-else statement
Sample:
If a50 Then
b=10
Else
b=70
End If
Use score as a variable
Use an if-Else if-Else if-Else if-End if-End if-End if-End if statement
Use 'Program 4-6' in Chap 03 as a sample.
Use amount as a variable
Use an if-nested if-nested if-Else-End if-End if-End if statement
Use selection as a variable
Use Switch (or Select)-'Case 1:'-Case 2:'-Case 3:'-Case 4:'-Default-End Switch(or Select) statement
Use speed as variable
Use if (condition 1) AND (condition 2) Then - Else - End if statement
Use points as variable
Use if (condition 1) OR (condition 2) Then - Else - End if statementUse points as variable
Use if (condition 1) OR (condition 2) Then - Else - End if statement
Use Program 4-10 in Chap 03 as a sample.
Use month as a variable
Use Switch (or Select)-Case 1:'-Case 2:'-Case 3:'-Default-End Switch(or Select) statement
Easy. Write your own code.
Debugging Exercises
Identify a wrong sign (a syntax issue).
Think about the precedence among!(NOT), &&(AND),II (OR) operators and the way you can change the precedence.
Reread 'Checking Numeric Ranges' section in Chap 03.
Give me an example of Algorithm Workbench ? ( )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!