CS 16, Winter 2018

Programming Assignment 1

Due: Monday, January 22, 11:59pm
Worth: 50 points

PA1 must be done individually - each student must accomplish it alone and submit it. Later assignments may allow students to work in pairs, but not this assignment.

  1. Write a C++ program in a file named hello.cpp to print a very specific message to the screen. Specifically, create a new file named hello.cpp (use emacs or another editor), and make the following edits to this file.
    1. Type a comment at the top with your name and the date you are doing this lab.
      Note: this is IMPORTANT, and you should make it a habit to include such a comment at the top of every program you ever write - especially for this class - from now on.
      Remember that a C++ comment begins with two slashes (//).
    2. Then type (or copy/paste) the following two lines after your header comment:
      #include <iostream>
      using namespace std;
    3. Define a main function:
      int main() { ... }
    4. Inside main, use cout and its insertion operator to print exactly the following message:
      Hello!
      CS16 is fun.
      Be sure the message prints on two separate lines, and that a newline is printed after the second line too. There must not be any spaces before or after the text on either line. Make sure it matches the sample exactly.
  2. Compile and test your program at CSIL (by connecting remotely is okay). Try to make it so that your first submittal earns all 50/50 points.
  3. Submit PA1 at https://submit.cs.ucsb.edu/, or use the following command from a CS terminal:
    ~submit/submit -p 933 hello.cpp
    Be sure to wait for the test results. If you score 50/50, and you've followed all of the other rules (e.g., name/date comment) then you'll earn full credit.
    Note: you should have created an account and joined the class CS16_w18_costanzo on the submit.cs system during Lab01. If you need help to do that now or to submit/verify your program, see this help for submit.cs page from that lab.

Updated 1/14/2018, by C. Michael Costanzo