Reference no: EM132158174
ONLY USE #include <stdio.h> and <math.h>
Write a C program, called linear solver.c, that solves single-variable linear equations.
The program should prompt the user to enter a linear equation of the form aY + b = c where a, b, and c are real numbers of type double.
The program should then output the value of Y that solves the equation, if such a value exists (see the note about verifying that a in nonzero).
If the input provided by the user is not valid, the program should terminate with an appropriate error message.
Notes:
I The character Y should appear in the input as a capital letter. Introduce this character into the program as a symbolic constant using #define, as follows: #define VARIABLE NAME ‘Y' When reading the equation using scanf(), you can use the %c conversion specification to read the character typed-in by the user, then compare this character with VARIABLE NAME.
I There should be no spaces in the input between the number a and the character Y. However, there may or may not be spaces around the + and = characters.
I If there is additional text after the equation, but the equation itself is valid, ignore the additional text and solve the equation as described above. For an example of this, see the second sample run.
I Verify that the value of a is not zero. If this is not the case, you should print an appropriate error message and terminate the program using return 1. See the third sample run.
I Print the value of Y that solves the equation with three digits of accuracy after the decimal point.
Identify and discuss one disadvantage or possible downside
: What are the benefits? Identify and discuss one disadvantage or possible downside.
|
Create a bookfactory to construct the required object
: Create a BookFactory to construct the required object and use the enum Books. Use virtual functions to read and print the data.
|
Discuss how the development of a mental health policy
: Discuss how the development of a mental health policy might decrease the stigma attached to mental health disorders.
|
Write a python program that prompts for an integer
: Write a Python Program that prompts for an integer and prints the integer, but if something other than an integer is input, the program keeps asking.
|
Prompt the user to enter a linear equation of the form
: The program should prompt the user to enter a linear equation of the form aY + b = c where a, b, and c are real numbers of type double.
|
Have all invested in global seed banks
: Very different organisations, such as governments, industry, and environmental agencies, have all invested in global seed banks.
|
Has there been evolution in this population
: Has there been evolution in this population? If yes, is natural selection involved? Explain and justify the answers.
|
Write java gui program to update this file
: Use java GUI JFileChooser to locate lab.txt from the file directory and use JTextArea to update the file.
|
Determine the expected frequency of colour
: If 15% of men in a population are colour blind, determine the expected frequency of colour blind women in this same population.
|