Hey everyone! I'm very new to programming (just now taking some beginner courses at school) and I have to write this code ... I'm at a stuck point getting these errors when trying to compile
Error E2451 ProgrammingProject1.cpp 12: Undefined symbol 'input' in function main()
Warning W8019 ProgrammingProject1.cpp 12: Code has no effect in function main()
Error E2292 ProgrammingProject1.cpp 13: Function should return a value in function main()
Warning W8066 ProgrammingProject1.cpp 14: Unreachable code in function main()
Error E2451 ProgrammingProject1.cpp 20: Undefined symbol 'a'
Error E2121 ProgrammingProject1.cpp 20: Function call missing )
The project is supposed to "repeatedly" prompt the user for 3 coefficients a,b,c and then evalute the expression below and display two values for x
x = 3(a+2b)+-sqrt(4-a^2)
c-a
If the user enters -999 for a then the program should terminate without asking for b or c
if -999 is not enter then it will prompt the user on separate lines for b and c then print the two values for x
it should also clear the screen at the beginning of each run
Like I said I'm very new and this project kinda got thrown at us from our professor and I definitely should've started on it earlier lol.
Here's what I got so far
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <iostream.h>
#include <math.h>
int main()
{
//Variable Declarations
double a, b, c;
//Variable Inputs
cout << "Enter the value of a: ";
cin >> a;
if(a = '-999');
return;
cout << "Enter the value of b: ";
cin >> b;
cout << "Enter the value of c: ";
cin >> c;
}
//Computations
double expression = 3(a+2b)/(c-a)+-sqrt(4-pow(a2))
//Output
if (expression == 0)
{
cout << "The answer is ";
}
if (expression = 0)
{
cout << "The answer is 0";
}
return 0;
|