Question: Obiectives . Be able to construct boolean expressions to evaluate a given condition Be able to compare Strings . Be able to use a flag

 Obiectives . Be able to construct boolean expressions to evaluate agiven condition Be able to compare Strings . Be able to usea flag . Be able to construct if and if-else-if statements toperform a specific task Be able to construct a switch statement .Be able to format numbers Introduction Up to this point, all theprograms you have had a sequential control structure. This means that allstatements are executed in order, one after another. Sometimes we need tolet the computer make decisions, based on the data. A selection controlstructure allows the computer to select which statement to execute In orderto have the computer make a decision, it needs to do a

Obiectives . Be able to construct boolean expressions to evaluate a given condition Be able to compare Strings . Be able to use a flag . Be able to construct if and if-else-if statements to perform a specific task Be able to construct a switch statement . Be able to format numbers Introduction Up to this point, all the programs you have had a sequential control structure. This means that all statements are executed in order, one after another. Sometimes we need to let the computer make decisions, based on the data. A selection control structure allows the computer to select which statement to execute In order to have the computer make a decision, it needs to do a comparison. So we will work with writing boolean expressions. Boolean expressions use relational operators and logical operators to create a condition that can be evaluated as true or false. Once we have a condition, we can conditionally execute statements. This means that there are statements in the program that may or may not be executed, depending on the condition. We can also chain conditional statements together to allow the computer to choose from several courses of action. We will explore this using nested if-else statements as well as a switch statement. In this lab, we will be editing a pizza ordering program. It creates a Pizza object to the specifications that the user desires. It walks the user through ordering, giving the user choices, which the program then uses to decide how to make the pizza and how much the cost of the pizza will be. The user will also receive a $2.00 discount if his/her name is Mike or Diane. Obiectives . Be able to construct boolean expressions to evaluate a given condition Be able to compare Strings . Be able to use a flag . Be able to construct if and if-else-if statements to perform a specific task Be able to construct a switch statement . Be able to format numbers Introduction Up to this point, all the programs you have had a sequential control structure. This means that all statements are executed in order, one after another. Sometimes we need to let the computer make decisions, based on the data. A selection control structure allows the computer to select which statement to execute In order to have the computer make a decision, it needs to do a comparison. So we will work with writing boolean expressions. Boolean expressions use relational operators and logical operators to create a condition that can be evaluated as true or false. Once we have a condition, we can conditionally execute statements. This means that there are statements in the program that may or may not be executed, depending on the condition. We can also chain conditional statements together to allow the computer to choose from several courses of action. We will explore this using nested if-else statements as well as a switch statement. In this lab, we will be editing a pizza ordering program. It creates a Pizza object to the specifications that the user desires. It walks the user through ordering, giving the user choices, which the program then uses to decide how to make the pizza and how much the cost of the pizza will be. The user will also receive a $2.00 discount if his/her name is Mike or Diane

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!