UMBC CS 201, Fall 08
UMBC CMSC 201
Fall '08

UMBC | CSEE | 201 | 201 F'08 | lectures | projects | help

CMSC 201
Programming Project One

World Traveler






Out: Tuesday 9/23/08

Due Date: By 11:59:59 PM, Sunday 10/5/08

The Objectives

The objective of this assignment is to get you familiar with good design practices, writing in C in a Unix environment, writing functions and using separate compilation. It will also give you experience with menus, using loops and switch statements.

The Background

Mrs. Evans, Ms. Block and three other faculty members from the CSEE department attended the SIGIR conference that was held in Tampere, Finland a few years ago. On the way, we stopped in London for one night and in Stockholm for the weekend. The conference was from Monday - Thursday in Tampere. After the conference, we took a bus tour to St. Petersburg, Russia. After the Russian tour, we spent the night in Helsinki, then another night in London before returning home.

Our trip caused us to visit 5 cities in 4 different countries. Each of these countries was in a different time zone and each used a different currency. All of Europe uses the Celsius scale for temperatures. It just seemed as if we were always doing conversions.

The Task

Your "World Traveler" project will allow the user to perform conversions from these four currencies into US dollars, calculate the time of day (Eastern Standard Time) from the time in each of the 5 cities visited, and also convert celsius temperatures into fahrenheit temperatures. Your program must be menu driven and will involve two different menus, the main menu and a menu of locations.

You will find the following information useful :

You MUST write this project using the design explained in lecture on 9/23 and 9/24 without modification.

You MUST use constants (#define) for each of the conversion factors shown above, both time and currency. You must also use constants for your menu choices and for any other item where they would be appropriate.

Your program MUST include the following functions. Do NOT change the function prototypes given below.

You MUST use separate compilation for this project.
So you should have 5 files:

Here is how you will be compiling these files :
gcc -c -Wall -ansi proj1.c
gcc -c -Wall -ansi travel.c
gcc -c -Wall -ansi util.c
gcc proj1.o travel.o util.o

Please notice that the travel.h and util.h files do not get compiled. Since they are header files they get #included at the top of .c files, but not compiled. The header files are absolutely necessary for a clean compile, so don't forget to submit them along with .c files.

Guarantees

Sample Run

linux1[101] % gcc -c -Wall -ansi proj1.c
linux1[102] % gcc -c -Wall -ansi travel.c
linux1[103] % gcc -c -Wall -ansi util.c
linux1[104] % gcc proj1.o travel.o util.o
linux1[105] % a.out

Your Greeting Goes Here


        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 1


Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 1

What time is it ?
hour ?
Please enter an integer between 0 and 23 : 22
minutes ?
Please enter an integer between 0 and 59 : 15

22:15 London time is  5:15 PM Eastern

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 1


Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 2

What time is it ?
hour ?
Please enter an integer between 0 and 23 : 10
minutes ?
Please enter an integer between 0 and 59 : 45

10:45 Stockholm time is  4:45 AM Eastern

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 1


Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 5

What time is it ?
hour ?
Please enter an integer between 0 and 23 : 24
Please enter an integer between 0 and 23 : 25
Please enter an integer between 0 and 23 : 28
Please enter an integer between 0 and 23 : 18
minutes ?
Please enter an integer between 0 and 59 : 60
Please enter an integer between 0 and 59 : 30

18:30 St. Petersburg time is 10:30 AM Eastern

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 2
Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 1

How many pounds ? 20
20.00 pounds is $ 37.07

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 2
Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 4

How many euros ? 75
75.00 euros is $ 110.51

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 2
Where are you ?

        1 - London

        2 - Stockholm

        3 - Tampere

        4 - Helsinki

        5 - St. Petersburg


Your location ?
Please enter an integer between 1 and 5 : 5

How many rubles ? 1000
1000.00 rubles is $ 39.97

        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 5
Please enter an integer between 1 and 4 : 0
Please enter an integer between 1 and 4 : -2
Please enter an integer between 1 and 4 : 3
Enter the celsius temperature : 27

27 celsius is 80 fahrenheit


        1 - Convert Time

        2 - Convert Currency

        3 - Convert Temperature

        4 - Quit


Your Choice ?
Please enter an integer between 1 and 4 : 4
linux1[105] %


Although your output need not look identical to the above, it must be neat and all information (including the greeting) must be present. The results of the conversions must be correct.

Submitting the Program

You must name your source file that contains main() proj1.c The file that contains the function definitions only useful for this project should be called travel.c and its header file should be called travel.h. The file that contains function definitions of modules that may be useful in other projects should be called util.c and its header file should be called util.h

To submit your project, type the following at the Unix prompt:

submit cs201 Proj1 proj1.c travel.c travel.h util.c util.h

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show all files that you submitted in a format similar to the Unix 'ls' command.

submitls cs201 Proj1


UMBC | CSEE | 201 | 201 F'08 | lectures | projects | help

Saturday, 04-Oct-2008 09:33:12 EDT