CSE12 Quiz 1 from some guy

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

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

0

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

Convert 0x9 to binary:

1001

What is the length of string "ABC"?

3

What character exists at the end of all strings in C and C++:

'\0'

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

'\n'

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

-1

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

0x0FEEDDAD

Convert 0xa to binary:

1010

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

Ctrl D

stderr is used to display what two kinds of messages:

Debug and error messages

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

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

Goodbye World Hello 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;)

It is in Hex

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

No

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

One year

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, 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

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

cout

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

If submiting a regrade request with a potential gain of 1 homework point through the Autograder, are you risking a deduction of your professionalism?

no

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

non-zero

Convert 0xd to binary:

1101

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

4

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

4 Binary Digits

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

A null char

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 ", stderr); writeline ("Goodbye World ", stdout);

Hello World Goodbye World

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

If it changes your grade for the entire quarter

Professional interactions involve what basic criteria.

It benefits you as a student

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;)

It is an Octal

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

It is in Decimal

When the standard input buffer is empty and your program calls fgetc, what is the resultant behavior of your program:

It waits for input from user

Should you print a NULL character in writeline?

NO

If asking for a regrade with a potential gain of 1% or more of your course grade, are you risking a deduction to your professionalism?

No

If asking for a regrade with a potential gain of <1% of the course grade after the grades appear on TritonLink when those points can change your grade, are you risking a deduction of your professionalism?

No

If asking for clarification about point deductions where the grading comments are insufficient are you risking a deduction of your professionalism?

No

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, 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 basout function, when processing a small positive number, you have a loop of processing that number terminating when what condition is met?

When the quotient is zero

List two situations that cause the standard output buffer to be displayed to the screen when running a C program?

When there is a newline character, and when the program is asking for output

If making a regrade request with a potential gain of 1 quiz point, are you risking a deduction of your professionalism?

Yes

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

Yes

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

a newline char

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

an int

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

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

import

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

input

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

negative

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

output

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

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

unaffected

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

'\n'

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

-1

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

0

Convert 0x5 to binary:

0101

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

0x0C0FFEE0

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

0x5

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

0x7FFFFFFF

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

0x8

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

0xF

Write the Hex value that represents all ones for 32 bits

0xFFFFFFFF

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

0xFFFFFFFF

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

runtime error after line is executed, or infinite loop


Kaugnay na mga set ng pag-aaral

expressions to check comprehension

View Set

PMP Ch 10 - Communications Management Questions

View Set

Fundamentals: Exam 1 Study Guide

View Set

Social Psychology Helping Others

View Set

paratiroidele, epifiza si timusul

View Set

Combining sentences: for, and, nor, but, or, yet, so

View Set

Maternity Test 2 Chapter 22 Application

View Set