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
Display "Your grade is A."
Design nested decision structures that perform the following: If amount1 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 51. 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 month 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.”
minimum is set.
End If
End If
End If
End If
multiple alternative decision structure / case structure
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 Display "Your grade is A." Design nested decision structures that perform the following: If amount1 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 51. 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 month 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. End If End If End If End If
Flowchart.
if (condition) statement else statement;
We can only feed 1 and can take 2 out from the decision box.
A Loop.
Making an assumption that you mean in a flowchart ... it is a diamond, wider than taller like: <>
In programming, a structure can define a set of related variables that can be grouped together. It allows for data to be organized in a more meaningful way, providing a more flexible and readable approach to data management. By defining a structure, you can access and manipulate multiple variables using a single entity, providing an alternative path of execution.
the most desirable alternative given up in a decision
A decision statement is an if statement. In flowcharts, we use a diamond shape to represent decisions (see below). By convention, if the condition is true, we follow a branch to the right (labelled true or yes as appropriate). The false condition usually travels down, but can also branch left (labelled false or no as appropriate). Either way, both branches must rejoin the main flow at some point above or below the decision after carrying out their respective task(s), which may include more decisions./\\/
Is the decision point in an IFTHENELSE statement is called an unconditional branch.
cost