1
h01
CS16 W19
Name:
(as it would appear on official course roster)
Umail address: @umail.ucsb.edu section
Optional: name you wish to be called
if different from name above.
Optional: name of "homework buddy"
(leaving this blank signifies "I worked alone"

h01: Chapter 1: Computer systems, introduction to C++

ready? assigned due points
true Thu 01/17 06:00PM Tue 01/22 09:00AM

Submit your homework as a pdf file through Gradescope before the due date listed above. There is NO MAKEUP for missed assignments; in place of that, we drop the lowest scores (if you have zeros, those are the lowest scores.)
For best results, save this page as a pdf, then print the pdf. Please write all your answers in the provided space. Homework submitted in a format different from the provided template will receive 0 points. Please mark your homework clearly, regardless of if you write it out digitally, or in ink or pencil!


Reading: Read Chapter 1, Sections 1.1 and 1.3.

Make sure your PDF does not contain any blank pages (remove them, if they are there, before submitting it).

    1. (4 pts) Write your: 1) College of Engineering username; 2) GitHub username:
    2. (1 pt) What is the size of the smallest data item in main memory that has a memory address? You may provide your answer in bits or bytes.
    3. (5 pts) The book talks about the five important hardware components of a computer i) input devices ii) output devices iii) processor iv) main memory and v) secondary memory. It also talks about two important pieces of software: compilers and operating systems. Which of the above is primarily responsible for each of the following tasks? Write 'none' if none of the options apply.
    i. Converts a program from a high-level language to machine language.
    ii. Executes a program stored in main memory.
    iii. Allocates the computer's resources to the different tasks that the computer must accomplish.
    iv. Stores a program while it is being executed.
    v. Converts a program from one high-level language to another high-level language.
    4. (2 pts) Not including any comments that may appear, what are the first two lines that typically begin a C++ program that is going to either output on the screen, and/or read input from the keyboard?
    5. (4 pts) As you discovered when you read the textbook, for the most basic kind of input and output, C++ uses two words, and two symbols, along with variables and quoted strings. Unlike in some other languages (e.g., Python), quoted strings must always use double quote marks "like this", never single quotes 'like this'. (Single quotes are used for another purpose in C++.) Inside a quoted string, '\n' means "newline". Quoted strings can only be output, while the value of a variable can be either output to the screen, or read in from the keyboard. Variable names are not put inside quotation marks. Also remember that every line of C++ that does input or output must end in a semicolon.
    Assuming the variable 'int age;' has already been declared and initialized with a value, write a single C++ statement that will print out 'My age is: ' followed by the value of the variable 'age', followed by a newline. (For full credit, be sure to end your line with a semicolon.)
    6. (4 pts) The textbook describes C++11 on p.27. Briefly, what is C++11? (A one sentence answer is good enough. Note that if your textbook doesn't describe C++11 on p. 27, then you may have the wrong edition. You need the ninth or tenth edition.)