UCSD CSE12 Quiz 1 W19 Gary Gillespie

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

As a signed integer, the bit pattern 0xFFFFFFFF in 32 bits is more commonly known as:

-1

Write the decimal value that represents all 1s for 32 bits as a signed value

-1

In C and C++, what is the numeric value of NULL?

0

In C and C++, what is the numeric value of false?

0

Convert 0x5 to binary

0101

Convert to hexadecimal: 0000 1100 0000 1111 1111 1110 1110 0000

0x0C0FFEE0

Convert to hexadecimal: 0000 1111 1110 1110 1101 1101 1010 1101

0x0FEEDDAD

What is the hexadecimal value for the largest signed positive number that can be stored using 32 bits?

0x7FFFFFFF

Write the hexadecimal value that represents all 1s for 32 bits

0xFFFFFFFF

How long do you have after a graded program or quiz is returned to you for you to raise issues about the grading on that program or quiz?

1 week

How long does a faculty member at UCSD have to easily make a correction to an assigned course grade?

1 year

Convert 0xa to binary:

1010

Convert 0xd to binary:

1101

What is the length of the string "ABC"?

3

How many binary digits are needed to represent one hexadecimal digit?

4

In C, what is the minimum character array size need to store the string: "ABC"?

4

Assuming a 4 bit unsigned word, convert the binary number 0101 to hexadecimal:

5

Assuming a 4 bit unsigned word, convert the binary number 1000 to hexadecimal:

8

Professional interactions involve what basic criteria?

Benefit people

What sequence of keystrokes causes CSE 12 programs to terminate normally:

Ctrl+D followed by nothing

In Java, C or C++ code, when a number begins without a prefix, what do you know about that number: (example: int zzz = 12;)

Decimal

Assuming a 4 bit unsigned word, convert the binary number 1111 to hexadecimal:

F

T or F: Control-D input works the same whether stdin is empty or not.

F

T or F: For full credit in CSE 12, if a function/method body has only one line of code, a function/method header isn't needed.

F

T or F: For full credit in CSE 12, if you didn't change a file that is part of your assignment, you still need to provide a file header.

F

T or F: For full credit in CSE 12, you should have one inline comment for every line of code in your program.

F

T or F: If your program passes all execution test cases, you will always get full credit for that assignment.

F

What is displayed to the terminal by the following C code: writeline ("Hello World ", stdout); writeline ("Goodbye World ", stderr);

Goodbye World Hello World

What is displayed to the terminal by the following C code: writeline ("Hello World ", stderr); writeline ("Goodbye World ", stdout);

Hello World Good bye World

In Java, C or C++ code, when a number begins with a leading 0x, what do you know about that number: (example: int zzz = 0x12;)

Hexadecimal

Is the array parameter to your writeline method in hw1 an input or an output parameter or both?

Input parameter

In C, assuming 0xFF is stored in a signed char, is the number positive or negative?

Negative

Should you print a NULL character in writeline?

No

Should you store the newline character as part of the string formed by getaline?

No

In C and C++, what is the numeric value of true?

Non-zero

Under what circumstance can you wait longer than one week to raise issues about the grading on a program or quiz?

None

What is the effect on the stdin buffer when the only the following keystrokes are entered: A B backspace

None

In Java, C or C++ code, when a number begins with a leading 0, what do you know about that number: (example: int zzz = 012;)

Octal

Is the array parameter to your getaline method in hw2 an input or an output parameter or both?

Output parameter

What word best describes when adding two positive numbers give a negative result?

Overflow

What is the one best word to describe an unsigned value in C or C++?

Positive

Assuming the following line of code in C executed, the list one situation where the string is not displayed to the user: fprintf (stdout, "Hello World");

Runtime error/Infinite loop

T or F: For all programming assignments, you need to run turnin.

T

T or F: For full credit in CSE 12, all inline comments need to be at the same indent level as the code being documented.

T

T or F: For full credit in CSE 12, descriptions of the algorithm for a method/function normally belong in the "Description" field of a function/method header.

T

T or F: For full credit in CSE 12, for file, class/struct and function/method headers, as long as the content is complete, you can follow a header style of your choice.

T

T or F: For full credit in CSE 12, if a file contains only one class or struct definition, you can have a combined file and class/struct header as long as all information is present.

T

T or F: For full credit in CSE 12, implementing a method for a class or struct mean that you need to have a class/struct header.

T

T or F: For full credit in CSE 12, you should have one inline comment for every idea that you implement in your program.

T

T or F: For full credit in CSE 12, your inline comments should justify the existence of code that follows.

T

T or F: For full credit in CSE 12, your name always belongs in the file header for those files that you authored or updated.

T

T or F: For full documentation credit in CSE 12, you need to have a comment describing the purpose of every variable, object and data field that you declare.

T

In your baseout function, when processing a small positive number, you have a loop of processing that number terminating when what condition is met?

When the result of division equals to 0

Should you store the NULL character as part of the string formed by getaline?

Yes

In C, in your writeline function, you have a loop of printing characters terminating when processing what character:

\0

Assuming the user inputs a short valid string, in your getaline function, you have a loop processing characters terminating when processing what character:

\n

Assuming the user inputs a valid number, in your decin function, you have a loop of processing characters terminating when processing what character:

\n

What character is the last one entered in every user response in C, C++ and Java when reading from standard input:

\n

An output statement to standard error starts with what word in C++?

cerr

An input statement from standard input starts with what word in C++?

cin

An output statement to standard output starts with what word in C++

cout

stderr is used to display what two kinds of messages:

error message/debug output

"using namespace" in C++ is most similar to what keyword in Java

import

In the following assignment in C, what is the type of the "character" variable: character = fgetc (stdin);

int

What two commands must you enter at the UNIX command line from the ~/../public/hw2 directory to begin working on hw2?

make directories, make install


Ensembles d'études connexes

ATI Engage EBP & Community program planning, implementation, and evaluation Module for EXAM 1

View Set

Foundations Exam 2 Chapter 16 PrepU

View Set

Med Surg Ch. 36 HIV/AIDS patient management

View Set

NA23- Patterns & General Rules 1

View Set

Investment Company Securities KM

View Set

Insurance License: Georgia Rules and Codes Pertinent to Life and Accident & Sickness Insurance Only

View Set