|
course.wilkes.edu/CS125Labs |
||||||
Hands On C++: Project 10
Objectives
1. Practice designing, declaring and using classes.
IntroductionEach of these projects deals with objects that are not readily modeled using the predefined C++ data types. In each project, you are to build a class to represent the object described, as well as the operations appropriate for such an object. Your instructor will tell you which one of the following projects to do.
Projects
10.1. Extend class
Alternatively, create a "drill" program that generates random fractions
(using class
For extra credit, overload ! as a 10.2. A quadratic equation has the form ax^2 + bx + c = 0where a, b, and c are all real values.
Write a class Quadratic that can be used to model a quadratic
equation, with operations to construct, input, output, extract the
data members of, evaluate (for a given value of x),
and find the x value at which the value of the Quadratic
is minimized (or maximized).
To test your class, write a menu-driven program that allows a user to enter a quadratic, and repeatedly process it using any of the provided operations.
10.3.
A phone number consists of four separate pieces of information:
an area code, an exchange, a local number, and a long-distance indicator
(true or false).
Design and build a
To test your class,
write a program that simulates an intelligent computer modem dialer
by reading a
10.4.
A playing card has two attributes, its rank
(e.g., 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A) and its suit
(e.g., clubs, diamonds, hearts, spades).
Design and build a
A deck of cards is simply a sequence of cards.
Design and create a class To test your classes, write a program that plays a simple card game (i.e., blackjack, go fish, etc.) against a human opponent.
Turn In:
Don't forget to clean up your directory when you are all finished...
|
Home Membership
|
|||||
|
Last update: Friday, August 25, 2000 at 3:44:36 PM. |
||||||