there's lots of brackets missing...look up how to do control statements in C++
'else' isn't used that way
'count' is probably a typo..
makes no sense: pressure is 0.19 t + 9.45 psi;
maybe u want this? pressure = 0.19 * t + 9.45 * psi;
but that doesn't matter much because psi and t are not initialized...
look up 'cin' which is 'cout's best friend XD
thank u soranz i tried the other way is this correct but the only 1 error is showing up is the 19 expected `;' before string constant what shall i do
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
// The value of pressure in pounds per square inch of a wareform;
const double Time= 35;
int t,psi;
cout << " nEnter time by user:";
{
if (t <= 35)
cout << 'pressure' << (0.46) << "psi";
}
{
(t >= 35)
"cout" << 'pressure' << (0.19 + 9.45) << "psi";
}
cout << "The pressure in psi and time in t" << pressure << endl;
system("PAUSE");
return 0 ;
i hope u can help me with this. plis
#include <iostream>
#include <cmath>
usingnamespace std;
int main()
{
//dont need ; in comments
// The value of pressure in pounds per square inch of a wareform;
constdouble Time= 35;
int t,psi;
cout << " nEnter time by user:"; //'n' wont produce a newline by itself. it needs the escape character...
{ //is cout a control statement ?
if (t <= 35) //yes, 'if' is a control statement
//this isn't how 'cout' works...and is not even consistent with the other one
cout << 'pressure' << (0.46) << "psi"; //this is the only line that will be executed when the condition is met
}
{ //brackets control the flow but there's nothing to control this block of code
//so it will always execute - making the bracket redundant...
(t >= 35) //what is the purpose of this ?
"cout" << 'pressure' << (0.19 + 9.45) << "psi"; //how is cout used ?
} //and this one too
//this is a good cout tho u might want an extra space after 't' for readability
cout << "The pressure in psi and time in t" << pressure << endl;
system("PAUSE");
return 0 ; //good end
//what's missing here ?
It looks like u also want to add functionality for user input. This can be accomplished with 'cin'. Where cout prints things out to the screen, cin takes inputs from a user which can be stored, manipulated and then printed out to the screen again using cout.