CS-183 Homework Assignment 1

Dr. Mark J. Sebern


Assignment

Please complete the following exercises:

  1. Create a C++ class for each of the following kinds of objects:
    1. An automated gasoline pump that can dispense three different grades of gasoline.
    2. A digital keypad combination lock.

    For each class, give a brief description of how an object of that class would operate. Then write a documented (commented) class definition including the declarations of all class data members and member functions. Be sure to include at least one constructor for each class. It is NOT necessary to implement the member functions of the class.

  2. Design and implement a C++ program to read in a text file, one line at a time. After reading each line, reverse the order of characters in the line and convert all vowels (AEIOU) to upper case and all other letters to lower case. Then write the modified line to an output file.

    Your program should prompt the user to enter the names of the input and output files. Use the C++ string class and the string getline function to process the data. Submit your program source code and sample input and output files.

Submission

The assignment (in one text file) should be submitted by email to Dr. Sebern. Please keep a backup copy in case your work gets lost in the email system. Please be sure to include your name in the assignment text file.

This assignment is due before the start of class on Thursday of week 2.

If you have any questions, or any part of the assignment is unclear, please consult the instructor.


This page was last updated on September 13, 2001; send comments to Mark Sebern.

Copyright information