Quiz #3

This quiz deals mostly with questions from chapter #4 in the text, or my suggested reading, JavaScript and topics discussed in class. If the answer on a T/F is False, please correct and explain.

Question #1: True or False: When comparing two values, things work best if they are of the same data type.

Question #2: What three things must be done to set up an effective loop?

Question #3: When you have an if statement like this the else is done when _____________.
if amt > 5000
   msg = "Enough"
   msg = "Low"
end if
Question #4: Looking at the example above, if amt > 5000, what is done?

Question #5: True or False: In most languages you can code a calculation in either of the following ways:
     ansWork = numIn -15
     numIn - 15 = ansWork
Question #6: True or False: ans = inv Ans + 20 is valid in programming languages such as JavaScript.

Question #7: Errors in the use of the programming language such as word usage and grammar are called ____________ errors?
A) logic
B) data
C) development
D) syntax
Question #8: Data that is stored in locations in memory are called ______________ ? An example would be storing the result of a calculation in memory.
A) alpha
B) instructions
C) variables
D) variables and instructions
Question #9:When you test a compiled program/object program with data, you are looking for _______ errors?
A) syntax
B) logic
C) compilar
D) both syntax and logic apply
Question #10: Calculating an answer and storing it to a named memory location is using ____________ ?
A) comparison
B) equal
C) assignment
D) compiling
Question #10: True or False: You cannot execute a program to produce output if it has critical syntax errors.

Question #12: You use quotation marks to enclose ____________________ .
A) string or character constant/literal
B) numeric constant/literal
C) variable names
D) string or character or numeric constant/literal
Question #13: The modules of the mainline logic of a typical procedural program are:
A) housekeeping, setup, initialization
B) housekeeping, processing, looping
C) housekeeping/setup, processing, wrapup
D) setup, initializing, looping
Question #14: True or False: Giving a starting value to a variable is known as initializing the variable. The value in the variable can be changed as the program executes.

Question #15: Using an if statement, write the code to test amt1 being equal to 100? You can write it in JavaScript or Visual Basic.

Question #16: What are the two things the + sign can mean?

Question #17: What do the { } do in an if statement in JavaScript?

Question #18: What is the statement in JavaScript that puts the words The grade is and the result of a calculation stored in mygrade up on the screen?

Question #19: Which loop structure executes the loop code at least once?

Question #20: Which loop structure can be set up so that you may or may not enter the loop code?