CS 630 - Computing Fundamentals I - Spring 2004
Homework 8
Loyola College >
Department of Computer Science >
CS 630 >
Homework >
Homework 8
Due
Thursday, March 25th at the beginning of class
Email programs (.cpp files) to lawrie@cs.loyola.edu
Problems
Problem 1: 6.3
Problem 2: 6.5 (Programming)
Problem 3: 6.8 (Programming) You may email one modified Time class with both additions
Problem 4: Write a C++ class definition for an abstract data type describing a food item consisting of the attributes and methods given. The attributes are as follows:
- description (character string of maximum length 100)
- size (floating-point number)
- price (floating-point number having two decimal points)
The member functions are:
- a constructor that is used to initialize all three attributes
- a function that changes the price of the food item to the value the caller specified
- a function that returns to the caller the price of the food item
- a function that displays in a readable form the information about the food item
- a functions that calculates the unit price of the food item and returns the value
*This is just the header file.