Thank you for pointing that out to me, but now I finish writing the code out and I able to compile it, only the proble is that when I enter the number it does not give me the letter grade. I pasted the code below, can you see anything wrong here?
#include <iostream>
using namespace std;
int main ()
{
char grade;
cout<<"Enter grade";...
User Profile
Collapse
-
If statement error
Hello:
I am trying to compile this block of code but every time I try to do so I get the same error message. Missing syntax before cout<<"Enter grade\n";
Can anyone tell me what is missing?
Thank you
#include <iostream>
using namespace std;
int main ()
{
char grade
cout<<"Enter... -
I have added the set of code you gave me and along with my code. I am still getting a error message. This is the new error I am receiving, and it is the only one. Can you please take a look at it.
C:\Program Files\Microsoft Visual Studio\MyProjec ts\webscript\ba nta.cpp(7) : error C2447: missing function header (old-style formal list?)...Leave a comment:
-
Mayday, mayday
I am trying to write this short program that will calculate, (1) the cost for hotel (45 a night), cost for gas (1.67 a gallon) and total cost. The car is going to be used for a total of 200 and it already 20 miles on it. I know that 200/20*1.67 is the correct formula but how would I get the visual 6.00C++ to recognize it.
Here is what I have so far:
#include<iostre am>
#include<iomani p>
using... -
QUOTE=Banfa][code]
if (grade>= 90)
letter_grade = 'A';
[/codeif is a statement NOT a function
What you have here is a complete if statement, it needs no closing, note I have corrected your string constant to a character constant and made your variable name valid.
If you want to execute more than 1 line of code when the condition is true then put in braces and have an if block
...Leave a comment:
-
help urgent
how do you use the if function and how would one declare its values, example for a grading system for school
#include (iostream)
using namespace std;
char letter-grade;
cout<<"enter grade";
cin>>grade;
if (grade>= 90)
letter -grade = "A";
what am I missing, and how do I close the statement once it reaches...
No activity results to display
Show More
Leave a comment: