COP 3014 Recitation - Week 10

UNIX operating system

Last week we wrote the Time class. Today we will modify our Time class to also have the capability of printing the time in MILITARY format. Examples of the difference between military format and regular format follow:

Time Military Time
9:30:59 AM 09:30
3:07:22 PM 15:07
3:07:22 AM 03:07
12:02:33 AM 00:02

You are required to complete this assignment in UNIX. If you DON'T already have a CS account, get one here.

NOTHING shows up when you're typing your password in in UNIX. So just type it in with confidence, without fear

To log on to one of the UNIX servers,
  1. click on the Windows menu, type "secure", and choose Secure Shell Client
  2. Press OR click on Quick Connect
  3. Hostname: linprog1.cs.fsu.edu (Type this in, don't click on it)
  4. Username: Your CS account username
  5. Press
  6. If your information is correct, you will be prompted to enter your password. Othewise, verify that the hostname and username entered are correct and that you have created a CS account using these instructions.
You can modify the code from last week for this assignment. You can copy and paste the files this time. Open your favorite text editor in UNIX to create main.cpp and time5.h. If you're not familiar with the UNIX text editors,
  • Type "nano" at the command line and press [Enter].
  • You are now using the nano text editor (It's similar to Notepad for Windows).
  • You can copy and paste the contents of the first file
  • Save the file by pressing Ctrl+O
  • Type "main.cpp" as the name of the file, press [Enter]
  • To exit the text editor and return to the command line, press Ctrl+X
  • If at any point you want to open main.cpp, type "nano main.cpp"
  • Type nano again to add the next file, save it and name it time5.h
  • To compile your program, type "g++ main.cpp"

Now you can modify the code in both files to give the Time class the capability to print the time in MILITARY format.
  • Why do we only specify "main.cpp" when compiling the program?
  • Try compiling this file in UNIX
  • Try compiling this file in UNIX
  • Try compiling this file in UNIX
  • Try compiling this file in UNIX


Program examples