answersLogoWhite

0


Best Answer

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.

  1. 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.

  2. 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."

  1. 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.

  2. 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

  1. 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.”

  2. 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.”

  3. 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.”

  1. 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

User Avatar

D Obaid

Lvl 2
2y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

If (x>100) Then

y = 20

z = 40

End If

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

from, the fortune teller :)

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you design an If-Then statement or a flowchart with a single alternative decision structure that assigns 20 to the variable y and 40 to the variable z if the variable x is greater than 100?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What structure allows you to test the value of a variable or an expression and then use that to determine which statement or set of statements to execute?

multiple alternative decision structure / case structure


Structure provides one alternative path of execution?

A sequence 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 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 &lt; 60 Then Display &quot;Your grade is F.&quot; Else If score &lt; 70 Then Display &quot;Your grade is D.&quot; Else If score &lt; 80 Then Display &quot;Your grade is C.&quot; Else If score &lt; 90 Then Display &quot;Your grade is B.&quot; Else Display &quot;Your grade is A.&quot; 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 &quot;You selected A.&quot; Else If selection == 2 Then Display &quot;You selected 2.&quot; Else If selection == 3 Then Display &quot;You selected 3.&quot; Else If selection == 4 Then Display &quot;You selected 4.&quot; Else Display &quot;Not good with numbers, eh?&quot; End If Design an If-Then-Else statement (or a flowchart with a dual alternative decision structure) that displays &ldquo;Speed is normal&rdquo; if the speed variable is within the range of 24 to 56. If speed holds a value outside this range, display &ldquo;Speed is abnormal.&rdquo; 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 &ldquo;Invalid points.&rdquo; Otherwise, it should display &ldquo;Valid points.&rdquo; Design a case structure that tests the month variable and does the following: If the month variable is set to 1, it displays &ldquo;January has 31 days.&rdquo; If the month variable is set to 2, it displays &ldquo;February has 28 days.&rdquo; If the month variable is set to 3, it displays &ldquo;March has 31 days.&rdquo; If the month variable is set to anything else, it displays &ldquo;Invalid selection.&rdquo; 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


Which organizational aid Includes decision points?

Flowchart.


Which statement in C plus plus is used to implement a decision structure in its simplest form-that of choosing between two alternatives?

if (condition) statement else statement;


In a flowchart how many arrows should feed into a decision box?

We can only feed 1 and can take 2 out from the decision box.


What structure causes a statement or set of statements to execute repeatedly?

A Loop.


What is the symbol for decision?

Making an assumption that you mean in a flowchart ... it is a diamond, wider than taller like: &lt;&gt;


Is the most desirable alternative given up as a result of a decision?

the most desirable alternative given up in a decision


What is a decision in a computer program and how is it represented in a flowchart?

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 decision point in an IFTHENELSE statement is called an unconditional branch in PYTHON?

Is the decision point in an IFTHENELSE statement is called an unconditional branch.


What is an alternative sacrificed because of an economic decision?

cost