Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need in JAVA. please attach a copiable code. Qn7 (4 points) Hand-trace the following code, showing the value of n and the output.

image text in transcribedPlease I need in JAVA. please attach a copiable code.

Qn7 (4 points) Hand-trace the following code, showing the value of n and the output. What error do you notice? int n 1 ; while (n ! = 50) { System.out.println(n); + 10; } n = n Qn8 (14 points) The roots of the quadratic equation ax2 + bx +c= 0,a # 0 are given by the following formula: -6+ Vb2 - 4ac (1) 2a = In this formula, the term V62 4ac is called the discriminant. If V62 4ac 0, then the equation has a single (repeated) root. If V62 4ac > 0, the equation has two real roots. If V62 4ac 0, the program should output the roots of the quadratic equation. (Hint: Use the method pow or sqrt from the class Math to calculate the square root.) Save the file as Assign2Qn8XX.java. Note that for your submission, you need to replace XX with your name

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

List the steps in the succession management process.

Answered: 1 week ago

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago