AdaptEd
Pod · look-only preview

C# Operators, Logic, and Math

Grade 9 Introduction to C# TEKS CS.3A, CS.3B 9 slides · 17 questions
Shared by Ochoa
Sign in to make a copy
Teachers: your copy includes the answer key.
Use with my class
No account needed. You get a link for students and a private page with their scores.
The answer key isn't shown here. Nothing you do on this page is saved or graded.
Opening

A Rocket Lost to a Calculation

A real photograph or video frame of the Ariane 5 Flight 501 launch shortly after the rocket breaks apart, with the launch plume and fragments visible against the sky. Keep the rocket and its expanding plume prominent; include no labels, arrows, or explanatory text.
Slide 1

Symbols That Calculate and Update

Slide picture
operator
— A symbol that performs an operation on values.
arithmetic operators
— Symbols used to calculate numeric results.
assignment operator
— A symbol that stores or updates a variable's value.
Check for understanding

Check Your Understanding

Categorize

Categorize each C# symbol by what it does.

Drag each item into the bucket it belongs in, or click an item and then a bucket. Click an item in a bucket to send it back.

Arithmetic operator
Assignment operator
0 / 5 placed
Slide 2

Comparisons, Text, and Comments

Slide picture
comparison operators
— Symbols that compare values and produce true or false.
strings
— Text values represented between quotation marks.
comment
— Code text that explains but does not execute.
Check for understanding

Check Your Understanding

Code CSHARP

Write a program that updates a lap count with += and prints it. Your program should print 10. Your program should print: 10

Write a complete C# program that starts with an integer variable laps set to 7, adds 3 to laps using the += assignment operator, and prints the updated value. The program should print 10.
62/4000 characters Waiting for input
Slide 3

Practice: Update a Supply Count

Slide picture
subtraction assignment
— An update that subtracts from a variable's current value.
multiplication
— Repeated addition used to calculate a total.
increment
— An increase of one in a variable's value.
Check for understanding

Check Your Understanding

Pick 1 Correct Answer

A lab has 5 trays with 8 seedlings each. Which calculation gives the total?

Choose the one correct answer.

Slide 4

Practice: Compare Sensor Readings

Slide picture
comparison
— An evaluation of two values using a comparison operator.
Boolean
— A value that is either true or false.
threshold
— A limit used to evaluate a measurement.
Check for understanding

Check Your Understanding

Code CSHARP

Write a program that checks whether a score meets a minimum. Your program should print True. Your program should print: True

Write a complete C# program that stores a score of 84 and a required minimum of 80, compares whether the score is greater than or equal to the minimum, and prints the Boolean result. The program should print True.
84/4000 characters Waiting for input
Slide 5

Combine Conditions with Logic

Slide picture
logical AND
— True only when both conditions are true.
logical OR
— True when at least one condition is true.
logical NOT
— Reverses a Boolean value.
Check for understanding

Check Your Understanding

Categorize

Place each condition result in its matching logical category.

Drag each item into the bucket it belongs in, or click an item and then a bucket. Click an item in a bucket to send it back.

true
false
0 / 5 placed
Slide 6

Useful Methods in Math

Slide picture
Math.Max
— Returns the larger of two values.
Math.Sqrt
— Returns the square root of a value.
Math.Round
— Rounds a decimal value to a nearby whole number.
Check for understanding

Check Your Understanding

Pick 1 Correct Answer

A tool must keep the smaller of two measured widths, 23 and 18. Which call returns that value?

Choose the one correct answer.

Slide 7

Practice: Calculate a Ramp Length

Slide picture
Math.Sqrt
— Returns a square root.
Math.Abs
— Returns a number's nonnegative distance from zero.
Math.Round
— Rounds a value to the nearest whole number.
Check for understanding

Check Your Understanding

Code CSHARP

Write a program that prints the square root of a measured area. Your program should print 14. Your program should print: 14

Write a complete C# program that calls Math.Sqrt with 196 and prints the result. The program should print 14.
47/4000 characters Waiting for input
Slide 8

Practice: Check a Drone Launch

Slide picture
logical AND
— Requires both conditions to be true.
logical OR
— Requires at least one condition to be true.
logical NOT
— Reverses a true or false result.
Check for understanding

Check Your Understanding

Categorize

Classify each Boolean expression by its result.

Drag each item into the bucket it belongs in, or click an item and then a bucket. Click an item in a bucket to send it back.

true
false
0 / 4 placed
Check for understanding

Solo Run: Operators, Logic, and Math

Pick 1 Correct Answer

A warning activates if either a gate is open or a motion sensor detects movement. Which expression matches this rule?

Choose the one correct answer.

Pick 1 Correct Answer

A sensor reports 42 units, and the warning threshold is 45. Which expression correctly checks whether the reading is below the threshold?

Choose the one correct answer.

Code CSHARP

Write a program that prints a rounded measurement. Your program should print 12. Your program should print: 12

Write a complete C# program that stores the decimal value 12.4, calls Math.Round on that value, and prints the result. The program should print 12.
61/4000 characters Waiting for input
Exit check

Show What You Know: C# Operators, Logic, and Math

Pick 1 Correct Answer

Which statement correctly describes the result of "Unit " + 4?

Choose the one correct answer.

Categorize

Classify each operator by its main role.

Drag each item into the bucket it belongs in, or click an item and then a bucket. Click an item in a bucket to send it back.

Calculate or compare
Assign or update
0 / 5 placed
Pick 1 Correct Answer

A building sends an alert if smoke is detected or heat exceeds its limit. Which expression matches that rule?

Choose the one correct answer.

Code CSHARP

Write a program to calculate and print the remaining tickets. Your program should print 32. Your program should print: 32

Write a complete C# program that starts with 45 tickets, uses 13 tickets, stores the updated count in the same variable using the -= assignment operator, and prints the remaining number. The program should print 32.
81/4000 characters Waiting for input
Categorize

Choose the method that best fits each calculation task.

Drag each item into the bucket it belongs in, or click an item and then a bucket. Click an item in a bucket to send it back.

Math.Abs
Math.Round
Math.Min
Math.Sqrt
0 / 4 placed
Pick 1 Correct Answer

If maintenanceNeeded is false, what does !maintenanceNeeded evaluate to?

Choose the one correct answer.