|
course.wilkes.edu/CS125Labs |
||||||
Hands On C++: Project 2
Objectives
1. Gain further experience constructing expressions.
IntroductionEach of the following projects involves the construction of expressions of various types, and so will provide practice in building expressions. Your instructor will tell you which one to do.
Projects2.1. Finish the lab exercise by completing the remaining experiments. 2.2. Write a program that finds the resistance of an electronic circuit with three parallel resistors resistor1, resistor2, and resistor3. The resistance can be computed using the following formula:
1
resistance = --------------------------------------
1 1 1
---------- + ---------- + ----------
resistor1 resistor2 resistor3
2.3. Using the y = ax^2 + bx + ccan be found using the quadratic formula:
solution1 = -b + the square root of (b^2 - 4ac)
-----------------------------------
2a
and
solution2 = -b - the square root of (b^2 - 4ac)
-----------------------------------
2a
Write a program that inputs values for a, b and c,
and outputs the values of solution1 and solution2.
Use boolean expressions and the assert() mechanism
to ensure that
2.4. Write a program that, given the amount of a purchase and the amount received in payment, computes the change in dollars, half-dollars, quarters, dimes, nickels and pennies.
Don't forget to clean up your directory when you are all finished...
|
Home Membership
|
|||||
|
Last update: Tuesday, August 22, 2000 at 1:06:47 PM. |
||||||