Design/project03.txt
.edu.INSTITUTION.USERNAME.hotj.project03
.edu.INSTITUTION.USERNAME.hotj.project03
package.Your instructor will assign you one of the problems below. To solve your problem, write a program that reads the necessary information to compute and output the indicated values, as efficiently as possible. Following the pattern in the lab exercise, first, design using OCD. Then code your design in Java using stepwise translation. Test your program thoroughly.
When executing your program to hand in as part of the project, a JUnit test case should test each method at least five times, but the test case itself needs to be executed just once. A driver program should be run at least five times with different inputs each time.
Project #3.1: Finish the lab exercise by completing the remaining experiments. If you are assigned this project, you do not have to create a new package for the project; just add to the code that you used in lab.
Project #3.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
Project #3.3: The two solutions of a quadratic equation
y = ax2 + bx + ccan be found using the quadratic formula:
solution1 = -b + the square root of (b2 - 4ac) ----------------------------------- 2aand
solution2 = -b - the square root of (b2 - 4ac) ----------------------------------- 2aWrite a program that inputs values for a, b and c, and outputs the values of solution1 and solution2. Use boolean expressions to print out
true
orfalse
for these conditions:
a
is zero, and- the expression
(b2 - 4ac)
is negative.
Project #3.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.
This grade sheet will be used to compute your grade.
Turn the following things:
Lab Home Page | Prelab Questions | Lab Exercise | Homework Projects