100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Scripting and Programming Actual FINAL PREP- Foundations - C173 with C173 Pre-Assessment Practice Questions $17.99   Add to cart

Exam (elaborations)

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

 4 views  0 purchase
  • Course
  • Scripting and Programming
  • Institution
  • Scripting And Programming

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-Asses...

[Show more]

Preview 4 out of 37  pages

  • October 28, 2024
  • 37
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Scripting and Programming
  • Scripting and Programming
avatar-seller
atiexpert
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.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller atiexpert. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $17.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

82871 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$17.99
  • (0)
  Add to cart