Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
37
Cijfer
A+
Geüpload op
28-10-2024
Geschreven 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

Meer zien Lees minder
Instelling
Scripting And Programming
Vak
Scripting and Programming

Voorbeeld van de inhoud

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.

Geschreven voor

Instelling
Scripting and Programming
Vak
Scripting and Programming

Documentinformatie

Geüpload op
28 oktober 2024
Aantal pagina's
37
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€16,55
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
atiexpert A.T. Still University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
384
Lid sinds
3 jaar
Aantal volgers
270
Documenten
4079
Laatst verkocht
1 week geleden
@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

64 beoordelingen

5
32
4
13
3
7
2
3
1
9

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen