1. !, &&, || are examples of conditional operators
2. ? is a logical operator
3. variable++ is a pretest increment
4. --variable is a posttest increment
5. Flags can also be integers
6. A switch is a control structure that can be used instead of an if/else statement
7. (-1 > 2) && (12 > 7)
8. With flags, all values besides zero are false.
9. The hierarchy for relational operators is !!, ||, &&
10. In a do while loop, a semicolon is required after the expression.
1. What does a flag normally do in code?
- a. Connect two or more relational expressions or reverse the logic of an expressionb. a Boolean or integer variable that signals when a condition existsc. Tests a series of conditions within the coded. Compare numeric char value and determine whether one is greater than, lees than, equal to, or not equal to another
1. Make a code to display the payment required for the age group input by the user.
- Adult price = $600k
- Senior price = $1 million
- Child, 6 & under = 50¢
2. Write a nested loop and switch statement for a customer choosing ice cream flavors and toppings.
3. Create a nested for loop that calculates your average yearly tuition based on how many classes you take. Assume 1 class = $215
4. Write a program that uses an if/else statement and switch statements to ask the user if they're male or female and give them options of clothing to choose from. Display the price of the article of clothing they choose.
5. Write a program that calculates the average of several grades input by the user. Allow the user to dictate how many grades will be used.
Find the Error
1 include iostream
2 using namespace std;
4 int main
6 char length, width, area
7 cout << "Define length, enter a number;
8 cin << length
9 cout << "Define width, enter a number",
10 cin >> width;
12 char area = length * width;
14 cout << "Area equals " << area << endl;
17 return 0;