expected un qualified-id

Hello I am very new to both these forums and programming so go easy on me. I would like some help with the following program I am trying to write.
It isn't a useful program just something to get me started. What I was trying to do was get the user to insert an integer between 1 and 10, then my program would multiply it by 1500. Using the code blocks compiler I wrote out the program and then recieved the following errors:
-error: expected unqualified id before: 'switch' and case and >> token
-error: cout does not have a name type.
and those sort of problems, here is the code (it's very poor):

#include <iostream>
using namespace std;

int main(void)
{
nNumber=1
cout << "Insert a number between 1 and 10:" << endl;
}
switch 'nNumber';
// Present each case and times the number by 1500 and show user the answer.

case 'nNumber';
extern istream cin; >> "1";
cout << "1" * 1500 endl;

case 'b';
extern istream cin; >> "2";
cout << "2" * 1500 endl;

case 'c';
extern istream cin; >> "3";
cout << "3" * 1500 endl;

case 'd';
extern istream cin; >> "4";
cout << "4" * 1500 endl;

case 'e';
extern istream cin; >> "5";
cout << "5" * 1500 endl;

case 'f';
extern istream cin; >> "6";
cout << "6" * 1500 endl;

case 'g';
extern istream cin; >> "7";
cout << "7" * 1500 endl;

case 'h';
extern istream cin; >> "8";
cout << "8" * 1500 endl;

case 'i';
extern istream cin; >> "9";
cout << "9" * 1500 endl;

case 'j';
extern istream cin; >> "10";
cout << "10" * 1500 endl;

}
{
cout << "number not accepted you moron."
}

system("PAUSE");
return 0;

it is my first program I have written so be nice ;), but I would appreciate some help.
Last edited on
This is complete nonsense and waste of anybody's time to correct or comment on.
I suggest you make a better attempt at learning C++.
You can start here http://www.cplusplus.com/doc/tutorial/ if you want.
From what you wrote only the initilal part of the code could be correct

1
2
3
4
5
6
7
8
#include <iostream>
 using namespace std;
 
int main(void)
 {
 nNumber=1
 cout << "Insert a number between 1 and 10:" << endl;
 }


provided that you would place semicolon after the first statement of the main and would specify the type of the variable:)

int nNumber=1;
Last edited on
Topic archived. No new replies allowed.