B Intro to IT unit 5 conditional statement assignment

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which statements are true about conditional statements? Check all that apply. A-They perform actions or computations. B-They are based on conditions. C-They can be executed only when conditions are false. D-They are also called conditional constructs. E-They are sometimes called compound statements. F-They have conditions that must be Boolean (IF, AND, or NOT) in form.

A-They perform actions or computations. B-They are based on conditions. D-They are also called conditional constructs. F-They have conditions that must be Boolean (IF, AND, or NOT) in form.

Why are conditional statements valuable to programmers? Check all that apply. A-They provide a way for programmers to add decision-making to a computer program. B-They allow programmers to specify conditions that must be met for an action to occur. C-They allow a program to evaluate multiple values within a statement. D-They allow programmers to set actions that will change the conditions.

A-They provide a way for programmers to add decision-making to a computer program. B-They allow programmers to specify conditions that must be met for an action to occur. C-They allow a program to evaluate multiple values within a statement.

You and a friend are writing code for a video game you designed. You want the code to take action based on how many ships you have left in your fleet. You will need an -Else statement. -Elif statement.

Elif statement

You have been asked to write some code for a teacher. The code will print encouraging statements for students who do not have an A in the class. The exact message will depend on whether the student has a B, C, D, or F in the class. You will need an -Else statement. -Elif statement.

Elif statement

As an intern for a small business, it is your job to write any code that is needed. Today you have been asked to write code that will add all order totals together if the customer is an active customer. If the customer is not an active customer, the code will print "inactive customer." You will need an -If statement. -Else statement.

Else statement

Which type of conditional statement has the following syntax (form)? if expression: statement(s) else statement(s) -If statements -If-Then statements -Elif statements -Else statements

Else statements

Which statement is a real-life example of an If statement? -The sun is shining today because a cold front has moved through. -If the sun is shining today, I will go to the beach. -The beach is cold today because it is October. -The sunny day causes the beach to be warm.

If the sun is shining today, I will go to the beach.

I plan to go to college if my grades are good enough. -not a conditional statement -conditional statement

conditional statement

If I do not go to college and stay home, then my parents want me to start paying rent. -not a conditional statement -conditional statement

conditional statement

If I do not qualify for any scholarships, then I will apply for student loans. -not a conditional statement -conditional statement

conditional statement

If I go to college, then my parents will let me take the extra car with me. -not a conditional statement -conditional statement

conditional statement

If my grades are very good, then I will select a college that offers scholarships. -not a conditional statement -conditional statement

conditional statement

I am thinking about going to college -not a conditional statement -conditional statement

not a conditional statement

I plan to visit several colleges to see what they offer and what the living situations look like. -not a conditional statement -conditional statement

not a conditional statement

I will also start working a part-time job to help pay for college. -not a conditional statement -conditional statement

not a conditional statement

Identify when programmers use an Else statement. -to use an If statement in its place to make the test answer true -to use an expression instead of a conditional statement to make the answer false -to tell the program to take a different action when the If statement answer is false -to tell the program to give different information when the test answer is true

to tell the program to take a different action when the If statement answer is false

When do programmers use If conditional statements? -when they want a certain event to occur when a condition is met -when they want to restrict an action from occurring when a condition is met -when they want a certain event to occur when a condition is not met -when they want to end a program

when they want a certain event to occur when a condition is met


Conjuntos de estudio relacionados

Milady Ch. 8 Skin Disorders and Diseases

View Set

APUSH First Semester Study Guide

View Set

Chapter 3: Ethics and Privacy Issues

View Set

Texas Promulgated, Law of Agency, National Real Estate Exam, TX: Real Estate Test Practice - NON MC

View Set

Diet Analysis Case: Diabetes Diet

View Set

Culture and Society FAU Pearson Revel Chapter 2

View Set