(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 sealene. Write a program that reads the lengths of 3 sides of triangles from the user. Display a message indicating the type of the triangle.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 6PP
icon
Related questions
Question
please answer it in c++ 3b
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Structured English
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning