Pre-Assessment: Scripting and Programming Foundations (RHO1/PRHO) – Western Governors University 2025 Edition | Complete Study Guide Featuring Learning Objectives, Sample Questions with Explanations, and Core Programming Concepts to Support Mastery

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

70 Terms

1
New cards

A car drove 200 miles using 10 gallons of fuel. Which operation should be used to compute the miles per gallon, which is 20?

Addition

Subtraction

Multiplication

Division

Division

2
New cards

Which operator should be used to determine if a number is evenly divisible by 5?

+

-

*

%

%

3
New cards

A variable should hold a person's height in meters.

Which data type should the variable be?

Integer

Float

String

Boolean

Float

4
New cards

A variable should hold the names of all past U.S. presidents. Which data type should the variable be?

Integer array

Float array

String array

Boolean array

String array

5
New cards

A program uses the number of seconds in a minute in various calculations. How should the item that holds the number of seconds in a minute be declared?

Constant float userTime

Variable float userTime

Constant integer secondsPerMinute

Variable integer secondsPerMinute

Constant integer secondsPerMinute

6
New cards

A program determines if a user's age is high enough to run for U.S. president. The minimum age requirement is 35. How should the item that holds the minimum age be declared?

Constant integer minAge

Variable integer minAge

Constant integer 35

Variable integer 35

Constant integer minAge

7
New cards

Given integer x = 3 and integer y = 5. What is the value of the expression (x / 2.0) + y?

5.0

6.0

6.5

7.5

7.5

8
New cards

Given float x = 10.2 and float y = 1.0. What is the value of the expression x / y?

0.0

1.0

10

10.2

10.2

9
New cards

What kind of operator is the == in the expression i == 20?

Assignment

Arithmetic

Equality

Logical

Equality

10
New cards

What is the purpose of parentheses () in a programming expression?

To print expressions

To group expressions

To run expressions

To compose expressions

To group expressions

11
New cards

Given float x = 3.0. Which expression evaluates to 2.0?

x/3*2+2

x-2/3

X+0.5/2

x/2+0.5/2+.25

x/2+0.5/2+.25

12
New cards

Which expression represents all the values of x, when x is the age ranging from 18 to 24 years old?

(x > = 18) or (x < = 24)

(x >= 18) and (x <= 24)

(x < 18) or (x > 24)

(x < 18) and (x > 24)

(x >= 18) and (x <= 24)

13
New cards

Which data type is used for items that are measured in length?

Integer

Float

String

Boolean

Float

14
New cards

Which data type should be used to keep track of how many planes are in a hangar?

Integer

Float

String

Boolean

Integer

15
New cards

What does a programmer do first to use an existing programming library?

Write the library's functions

Odify the library's functions

Include the library

Discard the library

Include the library

16
New cards

What relationship is common among a programming library's functions?

Functions all relate to the same purpose.

Each function competes with the other function.

Each function fixes bugs in the other functions.

Every function performs the identical computation.

Functions all relate to the same purpose.

17
New cards

What is an advantage of using a programming library?

The code has not been tested

The code has already been tested

The code can be used across programming languages

The code has already been compiled

The code has already been tested

18
New cards

Which language is dynamically typed?

C

C++

Java

Python

Python

19
New cards

Which language is not built on object-oriented design principles?

C

C++

Java

Python

C

20
New cards

A language substantially supports a programmer creating items like person, teacher, and students. Each item has internal data and some operations. Which characteristic describes that language?

Dynamically typed

Object-oriented

Markup

Statically typed

Object-oriented

21
New cards

A programmer wants a compiler to report an error if an integer variable is assigned with a string. Which kind of language should the programmer use?

Dynamically typed

Object-oriented

Markup

Statically typed

Statically typed

22
New cards

A language uses tags around text to indicate how that text should be formatted. Which characteristic describes a language having such tags?

Objects

Compiler

Script

Markup

Markup

23
New cards

What is a characteristic of a compiled language?

Runs one statement at a time by another program

Runs one statement at a time by another program

Converts to machine language before running

Runs on any machine having an interpreter

Converts to machine language before running

24
New cards

What is a characteristic of an interpreted language?

Runs faster than compiled languages

Outputs an interpreter to run the program

Runs easily on different kinds of machines

Needs to be converted to machine code first

Runs easily on different kinds of machines

25
New cards

What is an advantage of interpreted programs?

They generally run faster than compiled programs.

They can be modified at run time

They use memory more efficiently.

They create a separate file.

They can be modified at run time

26
New cards

Which characteristic specifically describes a markup language?

Tags surround text to describe desired formatting.

A program's execution marks output with numbers and strings.

A compiler marks statements with 0's and 1's.

An interpreter executes statements one at a time.

Tags surround text to describe desired formatting.

27
New cards

Which characteristic specifically describes interpreted languages?

They are written using pseudocode.

They consist of a set of functions and objects.

They can be run one statement at a time.

They are converted to 0's and 1's.

They can be run one statement at a time.

28
New cards

Which characteristic specifically describes interpreted languages?

They are drawn out using graphical diagrams.

They can run on any machine having the right interpreter.

They are compiled to machine code before being executed.

They substantially support decomposing a program into objects.

They can run on any machine having the right interpreter.

29
New cards

A function should convert hours and minutes to seconds, such as converting 1 hour and 10 minutes to 4,200 seconds. What should be the input to the function?

Hours only

Minutes

Only

Hours and minutes

Hours, minutes, and seconds

Hours and minutes

30
New cards

A function returns a number x cubed. For example, if x is 3, the function returns 3 3 3, or 27. What should be the input to the function?

x

x, x

x, x, x

27

x

31
New cards

A function calculates the weight difference (Diff) given two sample weights (S1 and S2). What should be the output from the function?

S1 only

S2 only

S1 and S2

Diff

Diff

32
New cards

function P(integer x) returns integer y y = 2 * x What does P(5) evaluate to?

2

5

10

25

10

33
New cards

Function F() Put "Hey" to output What entire output appears after three successive calls to F()?

Hey

HHHey

HeyHeyHey

Hey Hey Hey

HeyHeyHey

34
New cards

What is a valid user-defined function name?

A reserved word

Any valid identifier

Any variable name

A floating-point number

Any valid identifier

35
New cards

A function MyFct has an input x and an output z. What does MyFct return?

Nothing

x only

z only

x and z

z only

36
New cards

What is the return value of a function?

Output of a function

Call to run the function

Data passed to the function

Variable in the declaration of the function

Output of a function

37
New cards

A program should continue accepting input numbers, adding each to a sum, until a 0 is input. Which control structure should be used?

If statement

For loop

Multiple if statements

While loop

While loop

38
New cards

Joe is building an online game. He wants to provide a riddle and have the player guess the answer. The game needs to prompt the user to enter the answer, check to see if it the input provided does not match the correct answer, and continue prompting the user until the answer entered matches the correct answer. Which control structure supports Joe's needs?

For loop

While loop

Do-while loop

If-else branch

Do-while loop

39
New cards

What is put to output by the following pseudocode? x = 3 do Put x to output Put " " to output x = x - 1 while x > 0

3 2 1 0

3 2 1 0 -1

2 1 0

3 2 1

3 2 1

40
New cards

A programmer has developed the following code: count = 0 while count is less than 5: print 'Hello' What is the result of implementing this code?

'Hello' will print four times

'Hello' will print five times

The program will throw an error

'Hello' will print indefinitely

'Hello' will print indefinitely

41
New cards

What is the loop expression in the following pseudocode? i = 0 while i < 20 Put i to output i = i + 1

i

i<20

i=0

i=i+1

i<20

42
New cards

What is the loop variable initialization in the following pseudocode? y = 0 s = 100.0 while y < 10 s = s + (s * 5.0) y = y + 1

y = 0

y = y + 1

s = 100.0

s = s + (s * 5.0)

y = 0

43
New cards

Which phase of a waterfall approach would create a sequence diagram that specifies the required order of events between completed program components?

Analysis

Design

Implementation

Testing

Design

44
New cards

Which phase of an agile approach would define a hypothesis to find a problem in a program?

Analysis

Design

Implementation

Testing

Testing

45
New cards

Which phase of an agile approach would create an executable program?

Analysis

Design

Implementation

Testing

Implementation

46
New cards

Which phase of an agile approach would create a list of components needed to build an online auction site?

Analysis

Design

Implementation

Testing

Design

47
New cards

Which phase of a waterfall approach defines a program's goals?

Analysis

Design

Implementation

Testing

Analysis

48
New cards

After a programmer is done writing a program, another person runs the program hundreds of times, each time with different input, checking that each run yields correct output. Which phase of a waterfall approach is the person carrying out?

Analysis

Design

Implementation

Testing

Testing

49
New cards

A programmer decides a program should convert U.S. units to metric units and decides to write the program in C++ using several functions. Which phase of a waterfall approach is occurring when the programmer starts writing the program?

Analysis

Design

Implementation

Testing

Implementation

50
New cards

A company has a new project it wishes to implement to track and analyze employee and customer interactions. The company leadership determines that the system should support direct data entry as well as automated data capture of phone calls and emails. Which phase of the waterfall process is occurring?

Analysis

Design

Implementation

Testing

Analysis

51
New cards

A programmer shows a program's first version to a customer. The customer provides feedback, which causes the programmer to change the goals of the program. In which phase of an agile approach are goals changed based on customer feedback?

Analysis

Design

Implementation

Testing

Analysis

52
New cards

A programmer shows a program's first version to a customer. Based on feedback, the programmer begins writing a second version of the program. In which phase of an agile approach does the writing of a second version of the program occur?

Analysis

Design

Implementation

Testing

Implementation

53
New cards

A programmer shows a program's first version to a customer. Based on feedback, the programmer creates a second version, and then has a colleague run the second version on numerous inputs to ensure outputs are correct. Which phase of an agile approach is that colleague carrying out?

Analysis

Design

Implementation

Testing

Testing

54
New cards

A programmer is currently programming the fourth version of a program. Each version has additional features to satisfy more customers. In which phase of an agile approach does the programming of the fourth version occur?

Analysis

Design

Implementation

Testing

Implementation

55
New cards

Order the statements needed to output the minimum of x and y from first (1) to last (4). Select your answer from the pull down list.

If y < min, set min = y

Declare variable min

min = x

Put min to output

Answer:

Declare variable min

min = x

If y < min, set min = y

Put min to output

56
New cards

Given a start and end location and time traveled in hours, order the statements needed to calculate speed in miles per hour from first (1) to last (4). Select your answers from the pull-down list.

speedMph = distMiles / timeHours

Declare variables distMiles and speedMph

Put speedMph to output

DistMiles = endLocation - startLocation

Answer:

Declare variables distMiles and speedMph

DistMiles = endLocation - startLocation

speedMph = distMiles / timeHours

Put speedMph to output

57
New cards

Order the tasks needed to create a pyramid (large on bottom, small on top) on a table from first (1) to last (4). Select your answer from the pull down list.

Place largest shape

Place smallest shape

Place middle-sized shape

Clear table

Answer:

Clear table

Place largest shape

Place middle-sized shape

Place smallest shape

58
New cards

What does the following algorithm determine? if x == y z = 1 else z = 0

Whether x and y are the same

Whether x and y are negative

Whether x is 1

Whether x is 0

Whether x and y are the same

59
New cards

What does the following algorithm accomplish? x = Get next input if x == -1 Put "Goodbye" to output

Outputs -1 when user types any input

Outputs "x" when user types -1

Outputs -1 when x is positive

Outputs Goodbye when user types -1

Outputs Goodbye when user types -1

60
New cards

What does an output of 1 indicate for the following algorithm running on a five-element list of integers? i = 0 x = 0 while i < 5 if list[i] < 0 x = 1 i = i + 1 Put x to output

All integers are positive.

All integers are negative.

At least one integer is negative.

At least one integer is positive.

At least one integer is negative.

61
New cards

When should a programmer develop an algorithm to solve a problem?

Before knowing the problem

Before writing a program to solve the problem

While writing a program to solve the problem

After writing a program to solve the problem

Before writing a program to solve the problem

62
New cards

Which text represents an algorithm?

Cats and dogs have tails.

Insert key, turn key, open door.

The forecast for tomorrow is rain.

A box has balls, bats, and hats.

Insert key, turn key, open door.

63
New cards

Which text represents an algorithm?

Shake bulb; if it rattles, replace it.

Water is wet; fire is not wet.

Staring at the sun hurts the eyes.

The max speed is 60 mph.

Shake bulb; if it rattles, replace it.

64
New cards

An algorithm should output "OK" if a list's numbers are all non-zero, else the output is "Not OK." Which test is a valid test of the algorithm?

Input 0, 0, 0. Ensure output is "OK."

Input 5, 4, 0. Ensure output is "OK."

Input -3, -2, 5. Ensure output is "Not OK."

Input 99, 0, 5. Ensure output is "Not OK."

Input 99, 0, 5. Ensure output is "Not OK."

65
New cards

What is put to output by the following flowchart, if the input is 17?

Too young

OK

Too old

Nothing is put to output.

OK

<p>OK</p>
66
New cards

What is put to output by the following flowchart, if the input is 3 5 -1?

3 5 -1

3 5

6 10

6 10 -2

6 10

<p>6 10</p>
67
New cards

What is the purpose of the following class diagram?

Shows how the Employee class is used in the program

Describes the execution flow of the Employee class' operations

Specifies the Employee class' behavioral requirements

Depicts the Employee class' name, data members, and functions

Depicts the Employee class' name, data members, and functions

<p>Depicts the Employee class' name, data members, and functions</p>
68
New cards

What is the purpose of a use case diagram, such as the following diagram?

Describes how a user can interact with a program

Describes the data used in the program

Illustrates the flow of the program's algorithms

Shows the interaction between program components

Describes how a user can interact with a program

<p>Describes how a user can interact with a program</p>
69
New cards

Which elements are characteristic of a class diagram?

System's classes, attributes, and methods and their features, constraints, and relationships

Flow of logic and process interaction within a system

Physical resources or logical architecture of a system

Internal structure of a class and collaboration between classes or instances

System's classes, attributes, and methods and their features, constraints, and relationships

70
New cards

Review the following use case diagram:

What does a use case diagram do?

Diagrams a single use case

Connects several use cases to class diagrams

Provides an overview of several use cases

Lists use case goals

Provides an overview of several use cases

<p>Provides an overview of several use cases</p>