Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Computers and Programming - Practice Quiz 2 | COMP 112, Quizzes of Computer Science

Material Type: Quiz; Professor: Goldstein; Class: INTRO TO COMP & PRG-LOCAL 103; Subject: Computer Science; University: Wentworth Institute of Technology; Term: Unknown 1989;

Typology: Quizzes

Pre 2010

Uploaded on 08/16/2009

koofers-user-42i
koofers-user-42i 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NAME___________________________________________________
Wentworth Institute of Technology
Division of Professional and Continuing Studies
COMP112 Section 71 – Intro to Computers and Programming - Spring, 2008
Quiz 2 – Open Book – FOR THE MULTIPLE CHOICE QUESTIONS, THERE IS
POSSIBLY MORE THAN ONE CORRECT RESPONSE. I WILL COMPUTE YOUR
GRADE USING THE BEST 10 out of 12 QUESTIONS YOU ANSWER.
1. List 5 reasons for using functions and sub-procedures in your programs.
a._________________________________________________________
b._________________________________________________________
c._________________________________________________________
d._________________________________________________________
e._________________________________________________________
2. Write an expression that sets j equal to a random number
a. Between 1 and 6
b. Between 80 and 90 HINT: 80 to 90 is a total of 11, not 10 numbers.
3. Write the value of the following expressions: (HINT: test these in Immediate mode)
a. LEFT("Mary had a little lamb", 8)_________________________________
b. MID("My Bonnie lies over the ocean", 12, 3)_____________________
c. LEN("Happy Birthday")_______________________________________________
d. InStr("The Phantom Menace", "tom")________________________________
4. Draw the flowchart symbol that indicates a decision statement (branches to more than one direction of flow of the
program based on the results of an IF statement)
5. What VB keyword (statement) do you use to allocate space in memory for a variable?
6. List 5 different primitive Datatypes that you can use in VB.
a. ____________________________________________________________________________
b. ____________________________________________________________________________
c. ____________________________________________________________________________
d. ____________________________________________________________________________
e. ____________________________________________________________________________
/app/work/qkda3y-363745-2765013-quiz2comp112sp08-doc.doc 12/3/2020 1
pf2

Partial preview of the text

Download Computers and Programming - Practice Quiz 2 | COMP 112 and more Quizzes Computer Science in PDF only on Docsity!

NAME___________________________________________________

Wentworth Institute of Technology

Division of Professional and Continuing Studies

COMP112 Section 71 – Intro to Computers and Programming - Spring, 2008

Quiz 2 – Open Book – FOR THE MULTIPLE CHOICE QUESTIONS, THERE IS

POSSIBLY MORE THAN ONE CORRECT RESPONSE. I WILL COMPUTE YOUR

GRADE USING THE BEST 10 out of 12 QUESTIONS YOU ANSWER.

  1. List 5 reasons for using functions and sub-procedures in your programs. a._________________________________________________________ b._________________________________________________________ c._________________________________________________________ d._________________________________________________________ e._________________________________________________________
  2. Write an expression that sets j equal to a random number a. Between 1 and 6 b. Between 80 and 90 HINT: 80 to 90 is a total of 11, not 10 numbers.
  3. Write the value of the following expressions: (HINT: test these in Immediate mode) a. LEFT("Mary had a little lamb", 8)_________________________________ b. MID("My Bonnie lies over the ocean", 12, 3)_____________________ c. LEN("Happy Birthday")_______________________________________________ d. InStr("The Phantom Menace", "tom")________________________________
  4. Draw the flowchart symbol that indicates a decision statement (branches to more than one direction of flow of the program based on the results of an IF statement)
  5. What VB keyword (statement) do you use to allocate space in memory for a variable?
  6. List 5 different primitive Datatypes that you can use in VB. a. ____________________________________________________________________________ b. ____________________________________________________________________________ c. ____________________________________________________________________________ d. ____________________________________________________________________________ e. ____________________________________________________________________________ /app/work/qkda3y-363745-2765013-quiz2comp112sp08-doc.doc 12/3/2020 1
  1. What are two ways of displaying an answer to a user in a program. In other words what two subroutines or functions or statements can you use to show your answer? a. ____________________________________________________________________________ b. ____________________________________________________________________________
  2. Every program, no matter what computer language is used, has three major parts. What are they? (EACH PART JUST ONE WORD !!. Put those words in the boxes below)
  3. List 5 components of an “Integrated Development Environment” a. ____________________________________________________________________________ b. ____________________________________________________________________________ c. ____________________________________________________________________________ d. ____________________________________________________________________________ e. ____________________________________________________________________________
  4. What will appear in the textbox, assuming A=2 and B=5 : IF ( (A>1) OR (B < 1) ) THEN txtAnswer.Text = " Green Eggs and Ham"+ vbNewLine ELSE txtAnswer.Text = " Horton Hears a Who" + vbNewLine END IF txtAnswer.AppendText (" Is my favorite children’s book")
  5. State two differences between a Sub and a Function: a. ____________________________________________________________________________ b. ____________________________________________________________________________
  6. Circle the ones that ARE valid VB variable names. A. number of kids D. area of yard B. numberOfKids E. Computer_Number C. 1box /app/work/qkda3y-363745-2765013-quiz2comp112sp08-doc.doc 12/3/2020 2