Project #81005 - C++ simple program

 

Objective:

  1. Become familiar with control structures

  2. Become familiar with arithmetic in C++

  3. Become familiar with OOP in C++

Description:

Create a program that calculates and displays solutions to a quadratic equation.

Background:

A quadratic equation can be generalized by equation below:



Closed form solutions can be found for the zeros of a quadratic function conveniently. That is the locations (x) where the function is equal to zero can be found by the following equation:


Note that depending on the sign of the expression under the square root, your system (problem) may have complex solutions. Therefore your program should be able to produce real number, or complex number solutions.

Your program:

  • Should prompt the user to choose between quiting, or solving another problem. ASCII character “q” should denote quiting of the session, and “s” should denote solving another problem

  • If “q” is depressed, the program to terminate execution

  • If “s” is depressed, the program should proceed to obtain the three values a, b, and c that are needed to define a quadratic equation. After this step, your program should produce the two correct solutions.

  • If your program receives any other input, it should display the choices until one of “q” or “s” is produced

  • Since it is possible to have complex numbers as your solutions, your program should be prepared to calculate and display the complex numbers

Program requirements:

  • Your program should be properly commented

  • Your program should require no math or additional libraries and should only declare the available primitive types

Some examples :

Subject Computer
Due By (Pacific Time) 09/05/2015 01:00 pm
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy