CIS 325 - Intro to Programming - CH3

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What type of operation is used to store a value in a variable? a. Assignment operation b. Logical operation c. Arithmetic operation d. Sequential operation e. Repetition (loop) operation

a. Assignment operation

In programming, instructions that are understandable but not correct are said to contain: a. Logical errors b. Sequential statements c. Syntax errors d. Iteration statements e. Selection statements

a. Logical errors

Consider the following instructions carefully. What is wrong? Take your rental care key to the parking lot Try all the cars until you find the car it fits---that's your rental car a. The instructions are not efficient b. The instructions are not correctly ordered c. The instructions are ambiguous d. The instructions are not understandable e. There is nothing wrong with these instructions

a. The instructions are not efficient

How many assignment operations do you see in this algorithm? age = 20 yearsToRetire = 65 - age Display yearsToRetire a. 0 b. 1 c. 2 d. 3 e. 4

b. 1

How many inputs are included in the following requirements? REQUIREMENT: Write a program that asks the employee for their age. The program must subtract the age from 65, and display the age, followed by the number of years left to retirement. a. 0 b. 1 c. 2 d. 3 e. 4

b. 1

What will be displayed if this algorithm is executed? age = 20 yearsToRetire = 65 - age Display yearsToRetire a. 0 b. 20 c. 45 d. 65 e. 20, 45 and 65

b. 20

What type of operation is used to compare two values? a. Assignment operation b. Logical operation c. Arithmetic operation d. Sequential operation e. Repetition (loop) operation

b. Logical operation

Which variable name is an example of camelback notation? a. sales commission b. salesComission c. sales_commission d. SALESCOMISSION e. salescommission

b. salesComission

How many outputs are included in the following requirement? REQUIREMENT: Write a program that asks the employee for their age. The program must subtract the age from 65, and display the age, followed by the number of years left to retirement. a. 0 b. 1 c. 2 d. 3 e. 4

c. 2

What is an algorithm? a. Instructions with input b. Instructions that are always repeated one or more times c. A set of clearly written, unambiguous instructions to perform a task d. Instructions that combine English with the structure and syntax of programming languages e. Instructions that provide a choice between two or more actions

c. A set of clearly written, unambiguous instructions to perform a task

In programming, instructions that are not understandable because they do not use the language correctly are said to contain: a. Logical errors b. Sequential statements c. Syntax errors d. Iteration statements e. Sequential statements

c. Syntax errors

Consider the following instructions carefully. What is wrong? Face the audience Place your left leg forward Hold out your right hand over your head Extend your hand out from your shoulder a. The instructions are not efficient b. The instructions are not correct c. The instructions are ambiguous d. The instructions are not understandable e. There is nothing wrong with these instructions

c. The instructions are ambiguous

How many different variables do you see in this algorithm? age = 20 yearsToRetire = 65 - age Display yearsToRetire a. 0 b. 1 c. 2 d. 3 e. 4

d. 3

Which of the following questions need to be more specific in order to answer it correctly? a. What is the sum of 23 and 45? b. Can you tell me your age? c. Which traffic light color means STOP? d. Can you tell me how to get to the store? e. What was the year of the first moon walk?

d. Can you tell me how to get to the store?

What is pseudocode? a. Instructions with input b. Instructions that are always repeated one or more times c. A set of clearly written, unambiguous instructions to perform a task d. Instructions that combine English with the structure and syntax of programming language e. Instructions that provide a choice between two or more actions

d. Instructions that combine English with the structure and syntax of programming language

Consider the following instructions carefully. What is wrong? Prompt for startingOdometerReading Get startingOdometerReading Prompt for endingOdometerReading Get endingOdometerReading Display distanceTraveled distanceTraveled = endingOdometerReading - startingOdometerReading a. The instructions are not efficient b. The instructions are not correctly ordered c. The instructions are ambiguous d. The instructions are not understandable e.There is nothing wrong with these instructions

d. The instructions are not understandable

What does this algorithm display when it is executed? Set count to 0 REPEAT call in the next student ask the student their GPA IF the GPA is greater than 3.2 Congratulate the student UNTIL all students have been called Display count a. Displays 0 b. Displays the total number of students c. Displays the number of students with a GPA less than 3.2 d. Displays the number of students with a GPA of 3.2 or greater e. Displays the number of students with a GPA above 3.2

e. Displays the number of students with a GPA above 3.2

What will be displayed if this algorithm is executed? Set count to 0 REPEAT call in the next student ask the student for their GPA IF the student's GPA is greater than 3.2 Add 1 to the count UNTIL all students have been called Display count a. Displays 0 b. Displays the total numbers of students c. Displays the number of students with a GPA less than 3.2 d. Displays the number of students with a GPA of 3.2 or greater e. Displays the number of students with a GPA above 3.2

e. Displays the number of students with a GPA above 3.2

What is a selection statement? a. Instructions with input b. Instructions that are always repeated one or more times c. A set of clearly written, unambiguous instructions to perform a task d. Instructions that combine English with the structure and syntax of programming language e. Instructions that provide a choice between two or more actions

e. Instructions that provide a choice between two or more actions


Kaugnay na mga set ng pag-aaral

The Enlightenment & American Revolution

View Set

Communication Theory Exam 2: Study Guide

View Set

CPE109 Module 1: Evolution of Computer Network and Services

View Set

Professionalism and Ethics for RBTs

View Set

Chapter 7 Study Questions- Assessment and Intervention for Emerging Language

View Set

Conceptual Physics Ch 22 Electric Current

View Set

NURS 3: Module 2: Intro to Women's Health

View Set