Oakland University Java Script Program Project I need three programs done for this assignment, the rubric is attached to the file section. Where it says di

Oakland University Java Script Program Project I need three programs done for this assignment, the rubric is attached to the file section. Where it says display name just put George Abro. This also requires. 3 outputs for each. As with the in-class assignments, using the “snipping tool” cut and paste the
code into the Word Template Provided on D2L. Please make sure it is large
enough to read. Additionally, using the “snipping tool” cut and paste the output in
the same Word document for each test set.
Program 1
Write a Java console program to compute both roots of the quadratic equation
when the user provides the three coefficients A, B, and C.
Specifically,
A. Display “Your Name”
B. Display “Project_2 Problem_1”
C. Display “This program computes both roots of a quadratic equation”
D. Display “given the coefficients A, B, and C”
E. Real_1 = 0
F. Real_2 = 0
G. Imag = 0
H. D = 0
I. DD =0
J. Flag = ‘Y’
K. DO
a. A = Display “Enter A”
b. B = Display “Enter B”
C. C = Display “Enter C”
d. keyboard.nextLine(); // Consume remaining newline
e. D = (math.pow(B,2.0) – 4*A*C)
f. If D< 0 Then i. DD = math.sqrt(4*A*C - B*B) ii. Imag = DD/(2*A) iii. Real_1 = -B/(2*A) iv. Real_2 = -B/(2*A) g. If D == 0 Then i. Imag = 0 ii. Real_1 = -B/(2*A) iii. Real_2 = -B/(2*A) h. If D > 0 Then
i. Imag = 0
ii. Real_1 = (-B + math.sqrt(D)/(2*A)
iii. Real_2 = (-B – math.pow((D),0.5)/(2*A)
i. Display “Solution 1 is = “ + Real_1 & (“”) + “+j” & Imag)
j. Display “Solution 2 is = “ + Real_2 & (” “) + “=j” & Imag)
k. System.out.println(“Do you want to run the”
“program? (Y
yes, N =
no)”);
+
+
=
=
input keyboard.nextLine(); // Get string input
Flag input.charAt(0);//Get first character (0)
L. While (Flag ‘Y’ || Flag == ‘Y’).
M. System.exit(0)
==
O
X
¡GRASP target: C:Program FilesVavajdk1.8.0_65binjava.exe
Hit any key to start.
Professor O’Connor
Project_2 Problen_1
This program computes both roots of a quadratic equation
given the coeficients A, B, and C
Enter A
1
Enter B
2
Enter C
3
Solution 1 is = -1.0 +j1.4142135623730951
Solution 2 is = -1.0 -j1.4142135623730951
Do you want to run the program?

Purchase answer to see full
attachment

Leave a Reply