Write a program that computes the real roo's of a quadratic function. Your program should begin by prompting the user for the values of a, b and c. Then it should display a message indicating the number of real roots, along with the values of the real roots (if any).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
please answer it in c++ 3c
QUESTION 3
3| Bachelor of Engineering
(a) The length of a month varies from 28 to 31 days. In this task you are required to
create a program that reads the name of a month from the user as a string. Then your
program should display the number of days in that month. Display '28 or 29 days' for
F'ebruary so that leap years are addressed.
(b) A triangle can be classified based on the lengths of its sides as equilateral.
isosceles or scalene. All 3 sides of an equilateral triangle have the same length. An
isosceles triangle has two sides that are the same lengths and a third side that is a
different length. If all of the sides have different lengths then the triangle is scalene.
Write a program that reads the lengths of 3 sides of triangles from the user. Display a
message indicating the type of the triangle.
f(r) = ar? - lr - e
(c) A univariate quadratic function has the form:
where a, b and e are constants, and a is non-zero. The roots of a quadratic function
can be found by finding the values of x that satisfy the quadratic equation
. A quadratic function may have 0, 1, or 2 real roots. These roots can be computed
using the quadratic formula, shown below:
ー6にVF- tur
root
The portion of the expression under the square root sign is called the discriminant. Ir
the discriminant is negative then the quadratic equation does not have any real
roots. If the discriminant is 0, then the equation has one real root. Otherwise the
equation has two real roots, and the expression must be evaiuated twice, once using
a plus sign and once using a minus sign, when computing the numerator.
Write a program that computes the real roo's of a quadratic function. Your program
should begin by prompting the user for the values of a, b and e. Then it should display
a message indicating the number of real roots, along with the values of the real
roots (if any).
Transcribed Image Text:QUESTION 3 3| Bachelor of Engineering (a) The length of a month varies from 28 to 31 days. In this task you are required to create a program that reads the name of a month from the user as a string. Then your program should display the number of days in that month. Display '28 or 29 days' for F'ebruary so that leap years are addressed. (b) A triangle can be classified based on the lengths of its sides as equilateral. isosceles or scalene. All 3 sides of an equilateral triangle have the same length. An isosceles triangle has two sides that are the same lengths and a third side that is a different length. If all of the sides have different lengths then the triangle is scalene. Write a program that reads the lengths of 3 sides of triangles from the user. Display a message indicating the type of the triangle. f(r) = ar? - lr - e (c) A univariate quadratic function has the form: where a, b and e are constants, and a is non-zero. The roots of a quadratic function can be found by finding the values of x that satisfy the quadratic equation . A quadratic function may have 0, 1, or 2 real roots. These roots can be computed using the quadratic formula, shown below: ー6にVF- tur root The portion of the expression under the square root sign is called the discriminant. Ir the discriminant is negative then the quadratic equation does not have any real roots. If the discriminant is 0, then the equation has one real root. Otherwise the equation has two real roots, and the expression must be evaiuated twice, once using a plus sign and once using a minus sign, when computing the numerator. Write a program that computes the real roo's of a quadratic function. Your program should begin by prompting the user for the values of a, b and e. Then it should display a message indicating the number of real roots, along with the values of the real roots (if any).
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of Parenthesis
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education