Computer Science I Programming and Problem Solving - Project 7 | CS 23021, Study Guides, Projects, Research of Computer Science

Material Type: Project; Class: CS I PROG/PROBLEM SOLVING; Subject: Computer Science; University: Kent State University; Term: Fall 2006;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/01/2009

koofers-user-24o
koofers-user-24o 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS23021 Computer Science I
Project #7
Due at 11:59pm on Monday, December 4, 2006
The assignment contains two parts: (1) implementing a birth date class derived from date class (2)
accounting program using STL vector and handling exceptions. For the first part of the project, you can
reuse the code for your project #5.
Birth date. Create a class Bdate that stores a person’s (first) name and birth date. The class should be
derived from Date class created in Project 5. The class should inherit overloaded comparison and override
extraction and insertion operators. For insertion you can assume that fist a date (month day year) and then a
name (one word) is entered:
12 29 1953 Joe
Place your class definition and implementation in bdate.h and bdate.cpp respectively. Your class
has to work with a test program provided in testbdate.cpp. The test program is in the subversion
repository.
Accountant using vectors. Write a program that accepts a sequence of integers, prompts the user for the
index of the integer and prints this integer. Note that the input may span multiple lines. Zero signifies the
end of input. It should be NOT printed. You should NOT assume a bound on input size. Here is an example
dialogue:
Enter integers: 5 6 22 5
22 7
6 0
Enter index: 5
22
Your program should gracefully handle out-of-range index input:
Enter integers: 5 6 22 5 22 7 6 0
Enter index: 10
No such index
You should use STL vector to store the integers. You should implement dynamic vector size change as the
user inputs more integers. You should use exceptions to handle out-of-range index entry. Place your
program in a single file: accountant.cpp
The files needed for submission are bdate.h and bdate.cpp, date.h and date.cpp (original
Date class implementation) and accountant.cpp.

Partial preview of the text

Download Computer Science I Programming and Problem Solving - Project 7 | CS 23021 and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

CS23021 Computer Science I

Project

Due at 11:59pm on Monday, December 4, 2006

The assignment contains two parts: (1) implementing a birth date class derived from date class (2) accounting program using STL vector and handling exceptions. For the first part of the project, you can reuse the code for your project #5. Birth date. Create a class Bdate that stores a person’s (first) name and birth date. The class should be derived from Date class created in Project 5. The class should inherit overloaded comparison and override extraction and insertion operators. For insertion you can assume that fist a date (month day year) and then a name (one word) is entered: 12 29 1953 Joe Place your class definition and implementation in bdate.h and bdate.cpp respectively. Your class has to work with a test program provided in testbdate.cpp. The test program is in the subversion repository. Accountant using vectors. Write a program that accepts a sequence of integers, prompts the user for the index of the integer and prints this integer. Note that the input may span multiple lines. Zero signifies the end of input. It should be NOT printed. You should NOT assume a bound on input size. Here is an example dialogue: Enter integers: 5 6 22 5 22 7 6 0 Enter index: 5 22 Your program should gracefully handle out-of-range index input: Enter integers: 5 6 22 5 22 7 6 0 Enter index: 10 No such index You should use STL vector to store the integers. You should implement dynamic vector size change as the user inputs more integers. You should use exceptions to handle out-of-range index entry. Place your program in a single file: accountant.cpp The files needed for submission are bdate.h and bdate.cpp, date.h and date.cpp (original Date class implementation) and accountant.cpp.