Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a C++ program that prompt the user to input the elapsed time for an event in seconds (integer data type). The program then

image text in transcribed

1. Write a C++ program that prompt the user to input the elapsed time for an event in seconds (integer data type). The program then outputs the elapsed time in hours, minutes, and seconds. (Example: if the user entered: 9630 the output will be: 2:40:30) 2. Write a C++program to find the roots of quadratic equation, and also display a message to describe the roots: i.e.: 2 real roots x1 and x2 . 1 root (xi X2) no real roots, 2 complex roots Hint: Quadratic equation is a second order polynomial with 3 coefficients a, b, c. The quadratic equation is given by: ax+bx + c 0 The solution to the quadratic equation is given by 2 numbers x1 and x We can change the quadratic equation to the form of Quadratic Formula The solution to the quadratic equation is given by the quadratic formula: 1,2 The expression inside the square root is called discriminant and is denoted by &: A b2-4ac The quadratic formula with discriminant notation: T1,2 0 This expression is important because it can tell us about the solution: when > 0, there are 2 real roots xs(-b+VA)/(2a) and x2Hb-VA)/(2a] .When A 0, there is one root xi x-b/(2a) when

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

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions