Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Input: from file named prog6-IN.txt Output: standard output AND file named prog6-OUT.txt Write a program that will calculbate both roots of a quadratic equation. The

image text in transcribed
Input: from file named "prog6-IN.txt Output: standard output AND file named "prog6-OUT.txt Write a program that will calculbate both roots of a quadratic equation. The program should read inputs a, b, and c from the input file. Then the program should report what input it received. Finally, the program should calculate and write both roots to standard output (the screen) and a file. Your program should print the roots ordered from least to greatest. If the quadratic equation has a negative discriminant your program should output "NO REAL ROOTS If the two roots are the same only report one root az +br+c- 2a Sample Input Sample Output 1.-3,-102.00 5.00 3,6,31.00 2,-2,-12 -2.00 3.00 3,-2,20 NO REAL ROOTS Note: Round all output to 2 decimal places. Input: from file named "prog6-IN.txt Output: standard output AND file named "prog6-OUT.txt Write a program that will calculbate both roots of a quadratic equation. The program should read inputs a, b, and c from the input file. Then the program should report what input it received. Finally, the program should calculate and write both roots to standard output (the screen) and a file. Your program should print the roots ordered from least to greatest. If the quadratic equation has a negative discriminant your program should output "NO REAL ROOTS If the two roots are the same only report one root az +br+c- 2a Sample Input Sample Output 1.-3,-102.00 5.00 3,6,31.00 2,-2,-12 -2.00 3.00 3,-2,20 NO REAL ROOTS Note: Round all output to 2 decimal places

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

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

1. Who is responsible for resolving this dilemma?

Answered: 1 week ago