Question: 1 of 4 Lab 5 - CMPS 1044 - Computer Science ! If/Else Statements & Nested If/Else Statements Objectives: Demonstrate use of decision operator if

 1 of 4 Lab 5 - CMPS 1044 - Computer Science
! If/Else Statements & Nested If/Else Statements Objectives: Demonstrate use of decision
operator if in a variety of problem scenarios. Demonstrate use of relational
operators. Relational Operator: Operator that allows comparison of values to determine the

1 of 4 Lab 5 - CMPS 1044 - Computer Science ! If/Else Statements & Nested If/Else Statements Objectives: Demonstrate use of decision operator if in a variety of problem scenarios. Demonstrate use of relational operators. Relational Operator: Operator that allows comparison of values to determine the following less than greater than less than or equal to greater than or equal to equal to not equal to The result of a relational operator is a Boolean value true or false. Decision Statements: Statements that allow execution under various circumstances. ifis one of the Decision Statements. if (condition) // When condition represents a true statement, // Statement Set 1 will be executed. Statement set 1; } else // When condition represents a false statement, { 1/ Statement Set 2 will be executed. Statement set 2; ) Open a new project and type in the following example: #include #include #include using namespace std; int main() int x = 18, Y = 4; if (x else { cout V) { cout Note this strategy can be used even when more than one of the conditions can be true. In this case it is important to put the statements in the correct order. Type in and execute the following example which determines the letter grade based on the numeric grade. Try a variety of values for Score. int Score; cout > Score; cout - 90) cout = 80) { cout = 70) { cout = 60) cout Why is there no if (condition) on the final else statement? Will it still work when if (Score

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 Databases Questions!