Description: [The Weather Checker: Decision Making Using if/else Statements]. This program performs boolean expressions based on the user's input representing the temperature. Use of if and else statements.
Code:
ACM CCECC
[Decision Structure Logic]
SDF-01. Design an algorithm in a programming language to solve a simple problem.
AP CS A
[If else Statements and Conditional Operators]
CON-2.A Represent branching logical processes by using conditional statements.
CON-2.A.1 Conditional statements interrupt the sequential execution of statements.
CON-2.A.2 if statements affect the flow of control by executing different statements based on the value of a Boolean expression.
CON-2.A.3 A one-way selection (if statement) is written when there is a set of statements to execute under a certain condition. In this case, the body is executed only when the Boolean condition is true.
CON-2.A.4 A two-way selection is written when there are two sets of statements—one to be executed when the Boolean condition is true, and another set for when the Boolean condition is false. In this case, the body of the “if” is executed when the Boolean condition is true, and the body of the “else” is executed when the Boolean condition is false.
CON-2.A.5 A multi-way selection is written when there are a series of conditions with different statements for each condition. Multi-way selection is performed using if-else-if statements such that exactly one section of code is executed based on the first condition that evaluates to true.
CON-1.E Evaluate Boolean expressions that use relational operators in program code.
CON-1.E.1 Primitive values and reference values can be compared using relational operators (i.e., == and !=).
CON-1.E.2 Arithmetic expression values can be compared using relational operators (i.e., <, >, <=, >=).
CON-1.E.3 An expression involving relational operators evaluates to a Boolean value.
CON-1.F.1 Logical operators !(not), &&(and), and ||(or) are used with Boolean values. This represents the order these operators will be evaluated.
CON-1.F.2 An expression involving logical operators evaluates to a Boolean value.
CON-1.F.3 When the result of a logical expression using && or || can be determined by evaluating only the first Boolean operand, the second is not evaluated. This is known as short-circuited evaluation.
CON-1.G Compare and contrast equivalent Boolean expressions.
CS1
[Decision Structure Logic]
130.421.c.4.b Define and specify the purpose and goals of solving a problem;
130.421.c.4.f Design a solution to a problem;
130.421.c.4.g Code a solution from a program design;
130.421.c.4.l Analyze and modify existing code to improve the underlying algorithm;
130.421.c.4.n Select the most appropriate algorithm for a defined problem;
[If else Statements and Conditional Operators]
130.421.c.4.s Develop algorithms to decision-making problems using branching control statements;
Description: [The Weather Checker program: Multiple Conditions, if/else if Statements and the Use of the Nested if]. The use of multi conditions using if, else if, and nested if-statements.
Code
ACM CCECC
[Decision Structure Logic]
SDF-01. Design an algorithm in a programming language to solve a simple problem.
AP CS A
[If else Statements and Conditional Operators]
CON-2.A Represent branching logical processes by using conditional statements.
CON-2.A.1 Conditional statements interrupt the sequential execution of statements.
CON-2.A.2 if statements affect the flow of control by executing different statements based on the value of a Boolean expression.
CON-2.A.3 A one-way selection (if statement) is written when there is a set of statements to execute under a certain condition. In this case, the body is executed only when the Boolean condition is true.
CON-2.A.4 A two-way selection is written when there are two sets of statements—one to be executed when the Boolean condition is true, and another set for when the Boolean condition is false. In this case, the body of the “if” is executed when the Boolean condition is true, and the body of the “else” is executed when the Boolean condition is false.
CON-2.A.5 A multi-way selection is written when there are a series of conditions with different statements for each condition. Multi-way selection is performed using if-else-if statements such that exactly one section of code is executed based on the first condition that evaluates to true.
[Nested if]
CON-2.B Represent branching logical processes by using nested conditional statements.
CON-2.B.1 Nested if statements consist of if statements within if statements.
CS1
[Decision Structure Logic]
130.421.c.4.b Define and specify the purpose and goals of solving a problem;
130.421.c.4.f Design a solution to a problem;
130.421.c.4.g Code a solution from a program design;
130.421.c.4.l Analyze and modify existing code to improve the underlying algorithm;
130.421.c.4.n Select the most appropriate algorithm for a defined problem;
[If else Statements and Conditional Operators]
130.421.c.4.s Develop algorithms to decision-making problems using branching control statements;
Description: [The Weather Checker: Logical Operators]. Use of logical operators besides if, else if, and nested if-statements.
Code
ACM CCECC
[Decision Structure Logic]
SDF-01. Design an algorithm in a programming language to solve a simple problem.
AP CS A
[If else Statements and Conditional Operators]
CON-2.A Represent branching logical processes by using conditional statements.
CON-2.A.1 Conditional statements interrupt the sequential execution of statements.
CON-2.A.2 if statements affect the flow of control by executing different statements based on the value of a Boolean expression.
CON-2.A.3 A one-way selection (if statement) is written when there is a set of statements to execute under a certain condition. In this case, the body is executed only when the Boolean condition is true.
CON-2.A.4 A two-way selection is written when there are two sets of statements—one to be executed when the Boolean condition is true, and another set for when the Boolean condition is false. In this case, the body of the “if” is executed when the Boolean condition is true, and the body of the “else” is executed when the Boolean condition is false.
CON-2.A.5 A multi-way selection is written when there are a series of conditions with different statements for each condition. Multi-way selection is performed using if-else-if statements such that exactly one section of code is executed based on the first condition that evaluates to true.
[Logical Operators and Boolean Statements]
CON-1.E Evaluate Boolean expressions that use relational operators in program code.
CON-1.E.1 Primitive values and reference values can be compared using relational operators (i.e., == and !=).
CON-1.E.2 Arithmetic expression values can be compared using relational operators (i.e., <, >, <=, >=).
CON-1.E.3 An expression involving relational operators evaluates to a Boolean value.
CON-1.F.1 Logical operators !(not), &&(and), and ||(or) are used with Boolean values. This represents the order these operators will be evaluated.
CON-1.F.2 An expression involving logical operators evaluates to a Boolean value.
CON-1.F.3 When the result of a logical expression using && or || can be determined by evaluating only the first Boolean operand, the second is not evaluated. This is known as short-circuited evaluation.
CON-1.G Compare and contrast equivalent Boolean expressions.
CS1
[Decision Structure Logic]
130.421.c.4.b Define and specify the purpose and goals of solving a problem;
130.421.c.4.f Design a solution to a problem;
130.421.c.4.g Code a solution from a program design;
130.421.c.4.l Analyze and modify existing code to improve the underlying algorithm;
130.421.c.4.n Select the most appropriate algorithm for a defined problem;
[Logical Operators and Boolean Statements]
130.421.c.4.u Demonstrate proficiency in the use of the relational operators;
130.421.c.4.v Demonstrate proficiency in the use of the logical operators;
[If else Statements and Conditional Operators]
130.421.c.4.s Develop algorithms to decision-making problems using branching control statements;
ACM CCECC
N/A
AP CS A
N/A
CS1
N/A
Description: Introduction and demonstration of comparison of Strings using its reference values, which are the data variables of type String store, using comparison routines.
Code:
ACM CCECC
N/A
AP CS A
[Comparing String Objects]
CON-1.H Compare object references using Boolean expressions in program code.
CS1
[Comparing String Objects]
130.421.c.6.k Compare objects using reference values and a comparison routine;