Programming Language Quiz 1

07/19/2001


Machine Language

* Computer instructions that are expressed in "Machine-Code: are actually in binary form, whereas programming in "Assembly-Language" must be first composed by what process?
   __________________________________________________________________
   __________________________________________________________________

* This original code is properly referred to as the _______________ code.

* The "Intermediate-Code" for that is produced by the _______________ process.

* The advantage of assembly language over the "High-Level" language(s) is that it is
    __________________________________________________________________

BASIC Language

Explain the results of each of the following instructions: (be specific, and complete)

PRINT ________________________________________

PRINT "Hello" ________________________________________

PRINT TAB(18);"Hello"; ________________________________________

PRINT "Hello","Jack" ________________________________________

PRINT "Rt=";RT ________________________________________

PRINT "R1=";R1,"R2=";R2 ________________________________________

PRINT USING("& ###.#",V$,T) ________________________________________

X=RND(1) ________________________________________

FOR Z=1 TO 5000: NEXT Z ________________________________________

IF A<>B THEN GOSUB 9317 ________________________________________

LPRINT "Header" ________________________________________

CLS ________________________________________

More BASIC Language

* The GOSUB statement requires a ________ in the other module.

* The difference between "STOP" vs "END" statement is _________________________
    ______________________________________________________________________

* Explain the difference between VALUE(X) and VALUE(X,Z)
    VALUE(X) ______________________________________________________
    VALUE(X,Z) _____________________________________________________

C Questions

* All "C" programs must have a principle module called the _____ module.

* All "Functions" require the _____, to pass _____________ to the function.

* One difference between earlier versions, or simpler versions of "C", and the more demanding requirements of "C++" is that all functions require a description of the function in the first part of the program.
That description is called the ________________________________________.

Explain the results of each of the following instructions: (be specific, and complete)

printf("\r\nHello"); ___________________________________________________

printf("%i",n); ___________________________________________________

printf("%d",n); ___________________________________________________

printf("%c",ch); ___________________________________________________

printf("%s",nm); ___________________________________________________

for(n=1;n<=15;n++);
   {
    printf("Hi");
   } ___________________________________________________

do_em(25,39); ___________________________________________________

x=value[12]; ___________________________________________________

if(x=y) printf("d",x); ___________________________________________________

More C Questions

* "C" is case-sensitive, which means _________________________________________
    example: ___________________________________________________________________

* Explain the difference between placing a description of a variable in a function, v.s. placing it above main     ____________________________________________________
    _______________________________________________________________

* In the function description shown below, explain the following:

void do_this(int x, char ch)

"void" as used here describes _________________________________________

(int x, describes___________________________________________

char ch) describes___________________________________________

* The braces in the function description below serves what purpose?

int get_limits(int x, int y)

{
~~~~~~
~~~~~~~~
~~~~
}

* Explain the difference between these operators and conditions:

= ________________________________________
== ________________________________________

| ________________________________________
|| ________________________________________

& ________________________________________
&& ________________________________________

x = r++; ________________________________________
x = ++r; ________________________________________

< ________________________________________
<< ________________________________________

getch(); ________________________________________
getche(); ________________________________________