Docsity

C173 Intro To Computer Programming - Basic Constructs Of Programming - Exam Latest Update., Exams of Computer Programming

Toggle sidebar
bg1
C173 Intro To Computer Programming / Basic
Constructs Of Programming / Exam Latest
Update
Which is a named item used to hold a value? - ANSWER Variable
What are we referring to when we talk about "Grammar" in programming? -
ANSWER A programming language's strict programming rules for structure
Think Rules
Which of the following are valid expressions?
1. num = num != 5
2. 3
3. 8 + 8
4. x = 5 + 5 * (10+) - ANSWER 2. 3
3. 8+8
Which are assignment statements?
x = x * 2
x = x + 2
x >= 1
x == 1
x = 1
x <= 1 - ANSWER X= X * 2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download C173 Intro To Computer Programming - Basic Constructs Of Programming - Exam Latest Update. and more Exams Computer Programming in PDF only on Docsity!

C173 Intro To Computer Programming / Basic

Constructs Of Programming / Exam Latest

Update

Which is a named item used to hold a value? - ANSWER Variable What are we referring to when we talk about "Grammar" in programming? - ANSWER A programming language's strict programming rules for structure Think Rules Which of the following are valid expressions?

  1. num = num != 5
  2. 3
  3. 8 + 8
  4. x = 5 + 5 * (10+) - ANSWER 2. 3
  5. 8+ Which are assignment statements? x = x * 2 x = x + 2 x >= 1 x == 1 x = 1 x <= 1 - ANSWER X= X * 2

X= X + 2

X = 1

What type of data is being used? "true" - ANSWER String - Because of the quotations What type of data is being used? 7 - ANSWER Integer What type of data is being used? true - ANSWER Boolean What type of data is being used? 7.0 - ANSWER Float What type of data is being used? "7" - ANSWER String What type of data is being used? "7.0" - ANSWER string Grace's website asks users to confirm that they agree to the use of cookies and then records their answer. Which type of data is best suited to hold this confirmation? boolean string float integer - ANSWER Boolean Which type of data holds only whole number values?

Which operator evaluates the remainder of division? // % /

    • ANSWER % Which are relational operators? *= and = not != += <= > - ANSWER <= > Which are logical operators? != *= and > not <= = += - ANSWER And not Which are assignment operators? += not != >

and - ANSWER = += *= Which operator type evaluates to true or false? mathematical operator equality operator assignment operator relational operator logical operator - ANSWER Logical Operator Relational operator Equality Operator Which operator type defines the value of something? mathematical operator equality operator relational operator logical operator assignment operator - ANSWER Assignment Operator What is the value of this expression? x = 1 y = 2 X <= 3 or y > 1 true false - ANSWER True What is the value of this expression? x = 10 y = 20

Answers = constant variable string integer boolean float - ANSWER Variable Integer John's is creating a program about his daughter's first year of growth has many pieces of data used throughout the program. For each piece of data listed below, select both a classification of constant or variable AND the type of data most appropriate. Each item needs two answers. her height Answers = constant variable string integer boolean float - ANSWER Variable Float John's is creating a program about his daughter's first year of growth has many pieces of data used throughout the program. For each piece of data listed below, select both a classification of constant or variable AND the type of data most appropriate. Each item needs two answers. her weight

Answers = constant variable string integer boolean float - ANSWER Variable Float John's is creating a program about his daughter's first year of growth has many pieces of data used throughout the program. For each piece of data listed below, select both a classification of constant or variable AND the type of data most appropriate. Each item needs two answers. her social security number Answers = constant variable string integer boolean float - ANSWER Constant integer John's is creating a program about his daughter's first year of growth has many pieces of data used throughout the program. For each piece of data listed below, select both a classification of constant or variable AND the type of data most appropriate. Each item needs two answers. her birth parents name

z = x - 3 returns integer y function myNewFunction - ANSWER Integer X What happens if you define a function but do not call it? Nothing. The code will simply remain in memory but will not execute. The function will automatically execute when you load the script. The script will return an error. - ANSWER Nothing. The code will simply remain in memory but will not execute. A function, anyKey, has an input x and an output z. What does anyKey return? - ANSWER z function popcorn(integer k) returns integer y y = k * 2 What does popcorn(12) evaluate to? - ANSWER 24 function math(integer x) returns integer y y = 3 * x + 1 What does math(5) evaluate to? - ANSWER 16 Function hello() Put "Hello my friend" to output What output appears after two successive calls to the function? - ANSWER Hello my friendHello my fire Using the following function, which portion is the function declaration? function myFunction(integer b) a = b - 3 returns integer a + b myFunction(6) returns integer a + b a = b - 3 function myFunction(integer b) myFunction(6) - ANSWER function myFunction(integer b)

Using the following function, which portion contains the function's argument? function myFunction(integer b) a = b - 3 returns integer a + b myFunction(6) returns integer a + b a = b - 3 function myFunction(integer b) myFunction(6) - ANSWER myFunction(6) Using the following function, which portion calls the function? function myFunction(integer b) a = b - 3 returns integer a + b myFunction(6) returns integer a + b a = b - 3 function myFunction(integer b) myFunction(6) - ANSWER myFunction(6) Using the following function, which portion calls the function? function myFunction(integer b) a = b - 3 returns integer a + b myFunction(6) returns integer a + b a = b - 3 function myFunction(integer b) myFunction(6) - ANSWER

To control what code executes based on the result of a test expression. To control when pop up windows occur in your code. To loop through your code. - ANSWER To control what code executes based on the result of a test expression. What is it called if a "while" statement's test expression never changes to false? A good while statement Infinite Loop Definite Loop Circular Definition - ANSWER infinite loop How many times can you call a function to run? once. one hundred times; then you must reload the script. as many times as you want. - ANSWER As many as you want How many times will this loop iterate? for i = 0; i < 4; i = i + 1; // Loop statements - ANSWER 4 Fill in the blank so that the loop will iterate 10 times. for i = 1; _________; i = i + 1; // Loop statements i <= 10 i < 10 i == 10 i >= 10 - ANSWER I <= 10 What is put to output by the following pseudocode? x = 4 while x >= 0 Put x to output x = x - 2 - ANSWER 4 2 0

What is put to output by the following pseudocode? x = 6 while x > 0 Put x to output Put " " to output x = x - 2 - ANSWER 6 4 2 How many times does this loop run? a = 8 b = 4 while a % b == 0: Put a to output b = b + 2 - ANSWER 1 What is an algorithm? a sequence of steps that solves a problem, generating correct output for any valid input values a sequence of steps that sovles a problem and generates output a process or set of rules to be followed the number of computational resources used - ANSWER a sequence of steps that solves a problem, generating correct output for any valid input values Place the steps of this algorithm in the correct order to sort a stack of 1000 name tags. - ANSWER Which change would correct the following algorithm so that it will identify the maximum number from a list with values 2,7,8,3,9, max = 0 for each value if value > max max = value else max = 0

class diagram use case diagram sequence diagram activity diagram structural diagram behavioral diagram - ANSWER All Which diagrams are used in the analysis phase of the SDLC? class diagram use case diagram sequence diagram activity diagram structural diagram behavioral diagram - ANSWER use case diagram sequence diagram behavioral diagram Which diagrams are used in the design phase of the SDLC? class diagram use case diagram sequence diagram activity diagram structural diagram behavioral diagram - ANSWER class diagram sequence diagram structural diagram behavioral diagram Which diagrams are used in the implementation phase of the SDLC? class diagram use case diagram sequence diagram activity diagram structural diagram behavioral diagram - ANSWER activity diagram

behavioral diagram What is the purpose of a structural diagram? To visualize static elements of software. To visualize the dynamic behavior of software. To visualize the flow of an activity. To visualize how objects fit together. To visualize how users interact with a program. - ANSWER To visualize static elements of software. What is the purpose of a behavioral diagram? To visualize static elements of software. To visualize the dynamic behavior of software. To visualize the flow of an activity. To visualize how objects fit together. To visualize how user interact with a program. - ANSWER To visualize the dynamic behavior of software. What is the purpose of an activity diagram? To visualize static elements of software. To visualize the dynamic behavioral of software. To visualize the flow of an activity. To visualize how objects fit together. To visualize how user interact with a program. - ANSWER To visualize the flow of an activity. Which design phases are a part of the agile process? prototyping testing implementation iteration design analysis - ANSWER testing implementation

In which SDLC phase do you determine what should be included in the code? - ANSWER Design In which SDLC phase do you decide how processes should work? - ANSWER Design In which SDLC phase do you determine if the code works functionally? - ANSWER Implementation In which SDLC phase do you determine if the code works as designed and meets goals? - ANSWER Testing In which SDLC phase do you determine if the code is complete? - ANSWER Implementation Dividing a nonzero floating-point number by zero. Infinity Floating Point Literal Agile Not a number - ANSWER Infinity Checks how one operand's value relates to another. For example, >=. Equality operator Relational Operator Variable Variable declaration - ANSWER Relationship Operator A set of pre-written functions that carry out common tasks, that a programmer can use to improve productivity. - ANSWER Library An invocation of a function's name, causing the function's statements to execute. For Loop

Function Definition Function Call Do-While Loop - ANSWER Function call What occurs at runtime if a divisor is 0, causing a program to terminate? Run- Time error Divide - by - zero error Use case Diagram Equality Operator - ANSWER Divide - by - zero Error A sequence of statements only executed under a certain condition. Loop Branch Parameter Variable - ANSWER Branch A graphical language for creating computer programs. Flowchart Pseudocode Algorithm Class Diagram - ANSWER Flow chart UML diagrams used to design dynamic elements of a program Activity Diagram Waterfall Approach Behavioral Diagrams Structural diagrams - ANSWER Behavioral Diagrams A single 0 or 1. Bit byte variable integer - ANSWER Bit