0% found this document useful (0 votes)
2K views4 pages

Fa 1.1 CS10 8

A compiler translates an entire program at once, while an interpreter translates programs line by line. Comments are meant to explain a program to readers, not the computer. Syntax errors are found by the compiler/interpreter, while runtime errors are found by the computer during execution. Debugging involves finding and fixing errors in a program.

Uploaded by

Jemuel Flores
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views4 pages

Fa 1.1 CS10 8

A compiler translates an entire program at once, while an interpreter translates programs line by line. Comments are meant to explain a program to readers, not the computer. Syntax errors are found by the compiler/interpreter, while runtime errors are found by the computer during execution. Debugging involves finding and fixing errors in a program.

Uploaded by

Jemuel Flores
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

36/40

Pick the best replacements for 1 and 2 in the following sentence: When comparing compilers and
interpreters, a compiler is like 1 while an interpreter is like 2.

1 = software, 2 = hardware

1 = a process, 2 = a function

1 = translating an entire book, 2 = translating a line at a time

1 = object code, 2 = byte code

What is printed in the following statements?

s = "Matlab rocks";

fprintf("%d",strlength(s));

11

12

13

14

The following is a legal variable name in MATLAB:

A+Good_Grade

True
False
What are comments for?

For the people who are reading your code to know. In natural language, what the program is doing.

To tell the computer what you mean in your program.

Nothing in a short program. They are only needed for really large programs.

Nothing. They are extraneous information that is not needed.

What is the data type of "This is what kind of data"?

Integer

Character

Float
String

What is the difference between a high-level programming language and a low-level programming language?

It is high-level if the program must be processed before it can run, and low-level if the computer can
execute it without additional processing.

It is a high-level if you are standing and low-level if your are sitting.

It is high-level if it easy to program in and is very short; it is low-level if it is really hard to program in
and the programs are really long.

It is a high-level if your are programming for a computer and low-level if your are programming for a
phone or mobile device.

Which of the following is a syntax error?

Forgetting a semi-colon at the end of a statement where one is required.

Attempting to divide by 0

Attempting to divide by 1.

Forgetting to divide by 100 when printing a percentage amount.

Who or what typically finds syntax errors?

The programmer.

The teacher / instructor.

The compiler / interpreter.

The computer.

One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.

parse

source code

byte code

token
Who or what typically finds runtime errors?

The teacher / instructor

The interpreter.

The computer.

The programmer.

The fprintf function:

Sends information to the printer to be printed on paper.

Displays a value on the screen.

Tells the computer to put the information in print, rather than cursive, format.

Tells the computer to speak the information.

A string list can contain only letters.

True
False
Debugging is:

tracking down programming errors and correcting them

finding all the bugs in the program

removing all the bugs from your house

fixing the bugs in the program

What is printed by the following statements? ERROR ATA

s = "Matlab rocks";

fprintf(s[3]);

Error

c
A program is:

something you follow along at a play or concert.

The same thing as an algorithm.

A sequence of instructions that specifies how to perform a computation.

A computation, even a symbolic computation.

Source code is another name for:

The number (or "code") that you must input at the top of each program to tell the computer how to
execute your program.

The language that you are programming in (e.g., Matlab)

The instructions in a program, written in a high-level language

The environment/tool in which you are programming.

Which of the following statements are equivalent?

x=x+y

y += x

x=y+x

x += x + y

x++y

You might also like