The actual solution of the equation shall be done

Assignment Help C/C++ Programming
Reference no: EM13168417

Write a C++ program (without a use of global variables) to solve a single quadratic equation of the form:

a*x2 +b*x+c=0

with the following specific requirements:
1) Reading of coefficients a, b, c shall be done by a function named readCoeffs(). They shall be entered

as double’s from the keyboard by an operator, after prompt, as follows:
Enter coefficient a: <operator enters a>
Enter coefficient b: <operator enters b>
Enter coefficient c: <operator enters c>
<one empty line should follow this sequence of three prompts>
and returned to the caller as a structure with 3 fields.
2) The actual solution of the equation shall be done by a function named equSolver(), which takes three coefficients as parameters and returns a structure of three fields: two roots (if they exist) and a boolean indicator, whether the roots do exist.

3) The function equSolver() shall call another function named discr() to calculate and return the discriminant necessary to compute the roots.

4) After equation is solved, another function named outResults() shall display on the screen results of the calculation in the following format:

    a)  If the solutions (roots) exist in the real domain, the output shall look as follows:

                Quadratic equation with the following coefficients:
                a: <value>;  b: <value>;  c: <value>
                has the following roots
                Root1: <value>;  Root2: <value>;

    <one empty line should follow this sequence of lines>

    b)  In case there are no solutions (roots) in the real domain, the output shall look as follows:

    Quadratic equation with the following coefficients: a: <value>; b: <value>; c: <value>
    has no roots in the real domain.
    <one empty line should follow this sequence of lines>

5) All functions shall be placed in a file separate from main(), named funcs.cpp, and a makefile shall be constructed and used for compilation.

Reference no: EM13168417

Questions Cloud

Which gives the order for first ionization energies smallest : which gives the order for first ionization energies smallest to largest
Calculate the number of moles of each substance : A mass of 46 g of solid sodium reacts with 38 g of flourine gas to produce 84 g of sodium flouride, Na F.
What did she most likely do incorrectly in her experiment : A student found that her mixture was 15% NH4Cl, 20% NACL, and 75% SiO2. Assuming her calculations are correct, what did she most likely do incorrectly in her experiment?
What will be the molarity of a compound : What will be the molarity of a compound (1 litre) with a molecular weight of 169 and purity as 41%.
The actual solution of the equation shall be done : The actual solution of the equation shall be done by a function named equSolver(), which takes three coefficients as parameters and returns a structure of three fields: two roots (if they exist) and a boolean indicator, whether the roots do exist.
Design an asynchronous base 14 counter : Design an asynchronous base 14 counter that counts through the natural binary sequence from 0 (0000) to 13 (1101) and then returns to zero on the next count.
Program that takes the amount a person has spent : Program that takes the amount a person has spent and determines the discount ($15 per $175 spent).
Beyond corporate responsibility : What examples from the readings or audio lectures stick out the most in your mind? Why? Has your perception of service learning changed since our first week?
Adt for a two color double stack adt consists of two stacks : design an adt for a two color double stack adt that consists of two stacks one red and one blue and has its operations color coded versions of the regular stack adt operations.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd