CMSC 162
Fall 2017
08/24/2017
First Lab - getting back into things
Due:  end of lab
 

Handin:
You will be submitting two programs via the handin command on the server.

Assignment:  (worth 5 points) 

0)  STRONG ADVICE:
Create a directory on the server for your work in this course.  (Do this step ONLY for this assignment.  In the future, the directory will already be there.)
  • mkdir 162
Then, change to that directory:
  • cd 162
Make a directory for this lab:
  • mkdir lab0
  • cd lab0
yellow separator

1)  a)  Copy the FirstProg.cpp file to your directory via the following command:

  • cp ~scottmce/162files/FirstProg.cpp  .
b)  Run the program and see what it does.  Look through the code and understand it.  Ask any questions you may have.

c)  Modify the program to ask the user for the month of their birth.  If they were born in the Winter, make the end be "Barnacle".   If they were born in Summer, the end should be "Swashbuckler".  If they were born in the Spring, the end should be "Sparrow".  If they were born in the fall, the end should be "Beard".

d) Add comments to the program as appropriate.

Handin as follows:
handin cmsc162 lab0pirate   FirstProg.cpp

e)  Thought exercise:
How could you let the user enter their full name in one line and do the original behavior of the program?

yellow separator

2)  
    Create program thatasks the user for how many students are in a class.    If the user types in a number bigger than 30, the program should report "TOO MANY STUDENTS FOR THIS ROOM".    Otherwise, the program should report "Room can hold the class."


Handin as follows:
handin cmsc162 lab0room yourfilename.cpp