100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice Questions

Rating
-
Sold
-
Pages
37
Grade
A+
Uploaded on
28-10-2024
Written in
2024/2025

Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice Questions/Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice Questions/Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice Questions

Show more Read less
Institution
Scripting And Programming
Course
Scripting and Programming











Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Scripting and Programming
Course
Scripting and Programming

Document information

Uploaded on
October 28, 2024
Number of pages
37
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice
Questions

Which operator should be used to determine if a number is evenly divisible by 5? - correct
answer %
A car drove 200 miles using 10 gallons of fuel.


Which operation should be used to compute the miles per gallon, which is 20? - correct answer
Division
floating-point literal - correct answer a number with a fractional part, even if that fraction is 0,
as in 1.0, 0.0, or 99.573
string literal - correct answer consists of text (characters) within double quotes, as in "Go
#57!". A character includes any letter (a-z, A-Z), digit (0-9), or symbol (~, !, @, etc.).
A variable should hold a person's height in meters. - correct answer Float
A variable should hold the names of all past U.S. presidents. - correct answer String array
integer - correct answer A variable of type _______ can hold whole number values, like 1, 999,
0, or -25 (but not 3.5 or 0.001).
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? - correct
answer Constant integer secondsPerMinute
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? - correct answer Constant
integer minAge
Given integer x = 3 and integer y = 5.
What is the value of the expression ( x / 2.0) + y? - correct answer 6.5
Given float x = 10.2 and float y = 1.0.


What is the value of the expression x / y ? - correct answer 10.2
What kind of operator is the == in the expression i == 20? - correct answer Equality

,Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice
Questions

What is the purpose of parentheses () in a programming expression? - correct answer To group
expressions
Given float x = 3.0.


Which expression evaluates to 2.0? - correct answer x / 2 + 0.5 /2 + .25
Which expression evaluates to true only when the user is within 3 years of 21 years, given a
variable x containing a user's age? - correct answer ( x >= 18) and ( x <= 24)
Which data type is used for items that are measured in length? - correct answer Float
Which data type should be used to keep track of how many planes are in a hangar? - correct
answer Integer
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? - correct answer Hours and minutes
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?
Ax
B x, x
C x, x, x
D 27 - correct answer x
A function calculates the weight difference (Diff) given two sample weights (S1 and S2).


What should be the output from the function? - correct answer Diff
function P(integer x) returns integer y
y=2*x


What does P(5) evaluate to? - correct answer 10

,Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice
Questions

Function F()
Put "Hey" to output


What entire output appears after three successive calls to F()? - correct answer HeyHeyHey
What is a valid user-defined function name? - correct answer Any valid identifier
A function MyFct has an input x and an output z.


What does MyFct return?
A Nothing
B x only
C z only
D x and z - correct answer z only
What is the return value of a function? - correct answer Output of a function
Loop / loop body - correct answer A ________ is a program construct that repeatedly executes
the loop's statements (known as the loop body) while the loop's expression is true; when false,
execution proceeds past the loop.
while loop - correct answer A _______ that continues to repeat while a condition is true.
do-while loop - correct answer a ________ that first executes the loop body's statements, then
checks the loop condition. Compared to a while loop, a do-while loop is useful when the loop
should iterate at least once.
difference between while loop and do-while loop - correct answer While loop checks the
condition first and then executes the statement(s), whereas do while loop will execute the
statement(s) at least once, then the condition is checked.
for loop - correct answer a _______ consisting of a loop variable initialization, a loop
expression, and a loop variable update that typically describes iterating for a specific number of
times.
nested loop (inner/outer loop) - correct answer a ________ that appears in the body of
another loop
A program should continue accepting input numbers, adding each to a sum, until a 0 is input.

, Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice
Questions

Which control structure should be used? - correct answer While loop
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? - correct answer Do-while loop
Psuedocode - correct answer text that resembles a program in a real programming language
but is simplified to aid human understanding
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
A3210
B 3 2 1 0 -1
C210
D 3 2 1 - correct answer 3 2 1
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? - correct answer 'Hello' will print indefinitely.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
atiexpert A.T. Still University
View profile
Follow You need to be logged in order to follow users or courses
Sold
376
Member since
3 year
Number of followers
270
Documents
4054
Last sold
6 days ago
@Nclex

SPECIALIZED ON; ####@NCLEX..........QA################################## [LATEST UPDATE 2022/2023 .ALL NCLEX EXAM AVAILABLE .HESI LATEST .ATI 100% CORRECT AND ALL RELATED HESI,NCLEX AND ATI TESTBANK ,BUNDLES AND FLASHCARDS]

3.9

63 reviews

5
31
4
13
3
7
2
3
1
9

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions