Author |
Message |
chips LL
|
PostPosted: Sat Dec 05, 2009 6:27 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
ok like, im kinda new to programing so shit if anyone can help me PLOX do!
mainly looking to jiza and bob cuz i know they both no how to do something with it!
problem= on my compiler (microsoft visual C++ 2008) it says that cin and cout arent properly named or somethin as i posted what it gives me as the problem below
um ok this is my code so far
*this is a program to find out 5 grades then average them, then i have to list those grades or w,e, the implementation of the code is no prob, I am pretty creative when it comes to getting around shizz,, so ya, but I cant get around cout and cin,,, its like all essential and stuff
but ya heres my code thus far
// program in C++___ project
// anthony selby
//problem area
std::cin
std::cout
using namespace std;
#include <iostream>
// where processing begins
int main ();
{
int ga1; int gaII; int gaIII; int gaIIII; int gaIIIII;
cout << "Enter test grade 1: ";
cin >> ga1;
if (ga1 < 0)
{
cout << "your entered a negative number, grades cannot be negative : ";
}
else if (gaII>0)
{
cout << "enter test grade 2: ";
cin << "gaII";
}
else
cout << "you entered zero";
cout << endl << "The absolute value is " << << endl;
return 0;
}
i[u] I get this era[/u]
----------------------------------------------------------------
1>Compiling...
1>as 1.cpp
1>g:\as 1\as 1.cpp(4) : error C2653: 'std' : is not a class or namespace name
1>g:\as 1\as 1.cpp(5) : error C2653: 'std' : is not a class or namespace name
1>g:\as 1\as 1.cpp(8) : error C2146: syntax error : missing ';' before identifier 'cout'
1>g:\as 1\as 1.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>g:\as 1\as 1.cpp(8) : error C2143: syntax error : missing ';' before 'using'
1>g:\as 1\as 1.cpp(8) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>g:\as 1\as 1.cpp(8) : error C2871: 'std' : a namespace with this name does not exist
1>g:\as 1\as 1.cpp(14) : error C2447: '{' : missing function header (old-style formal list?)
-----------------------------------------------------------------
note the code isnt finished, i just want to be able to build it now and get rid of the eras i know will pop up again in this compiler (using visual C++)
I also didnt complete the precode or w,e u want to call it where i basically say wtf i want to do in the whole program,, but here it is below
set declarations
//program purpose- average 5 test grades together
//set enter grades into average formula
//(gradeA + gradeA + gradeA +gradeA + gradeA)/ 5
//display grade average,
//the student variable = number of students being compared
Set variables for list
set interger variables- gradesA 1-5 //use ticks to number
ga1, gaII, gaIII, gaIIII, gaIIIII
second set of grades-
gb1, gbII, gbIII, gbIIII, gbIIIII
third set of grades-
gc1, gcII, gcIII, gcIIII, gcIIIII
fourth set of grades-
g41, g4II, g4III, g4IIII, g4IIIII
5th set of grades
g51, g5II, g5III, g5IIII, g5IIIIIl.,.
============section y================
cout-ask how many students your grading today? (max 5)
cin- variable 'Student'
if (student >5)
cout you have entered a number greater than 5, maximum is 5
try again (endl)
move to section y
else if (student <0)
cout this program doesn't accept negative numbers
move to section y
else if (student=0)
cout to little grades to find class average
else if (student=1)
move to section 1
else if (student=2)
move to section 2
else if (student=3)
move to section 3
else if (student=4)
move to section 4
else if(student=5)
move to section 5
===============section 1====================
int name1
cout enter your first students name
cin name1
cout enter name1 's 1st test grade
cin ga1 (endl)
cout enter first name1 's 2nd test grade
cin gaII (endl)
Cout enter first name1 's 3rd test grade
cin gaIII (endl)
cout enter first name1 's 4th test grade
cin gaIIII (endl)
cout enter first name1 's 5th test grade
cin gaIIIII (endl)
cout ga1,gaII, gaIII, gaIIII, gaIIIII,endl
cout are these grades correct? y/n
cin cs1
if (cs1= y)
cout name1 's average is [(ga1+gaII+gaIII+gaIIII+gaIIIII)/5]
go to section z
if (cs1= n)
go to section 1
=====================section 2====================================
int name1
int name2
cout enter your first students name
cin name1
cout enter name1 's 1st test grade
cin ga1 (endl)
cout enter first name1 's 2nd test grade
cin gaII (endl)
Cout enter first name1 's 3rd test grade
cin gaIII (endl)
cout enter first name1 's 4th test grade
cin gaIIII (endl)
cout enter first name1 's 5th test grade
cin gaIIIII (endl)
cout ga1,gaII, gaIII, gaIIII, gaIIIII,endl
cout are these grades correct? y/n
cin cs1
if (cs1= n)
go to section 2
else (cs1= y)
cout name1 's average is [(ga1+gaII+gaIII+gaIIII+gaIIIII)/5]
cout enter name2 's 1st test grade
cin ga1 (endl)
cout enter first name2 's 2nd test grade
cin gaII (endl)
Cout enter first name2 's 3rd test grade
cin gaIII (endl)
cout enter first name2 's 4th test grade
cin gaIIII (endl)
cout enter first name2 's 5th test grade
cin gaIIIII (endl)
===============section 3====================
===============section 4====================
===============section 5====================
===============section z====================
cout thanks for using anthony selbys grading program
cin *complete*
_________________ king of the run on sentence.
|
|
Top |
|
|
Apocalypse
|
PostPosted: Mon Dec 07, 2009 9:05 pm |
|
Joined: Wed May 23, 2007 8:50 am Posts: 2398
Bot Check: GAMER
Website: http://www.dxgaming.com
Location: United States of America
|
|
Top |
|
|
Wizard_of_Gore
|
PostPosted: Tue Dec 08, 2009 9:05 am |
|
Joined: Sat Dec 18, 2004 8:02 am Posts: 2592
Bot Check: GAMER
Website: http://jizaboz.com
Location: USA
|
Hrm. Well yr structure is a bit weird lol, but anyway... try putting
Code: using std::cout;
using std::cin;
AFTER
Code: #include <iostream>
instead of before.
Then, let us see a paste of your exact compiler error if you still get one.
_________________ Ultima avatar: The Famed JIZABOZ,GWAR Guildmeister
|
|
Top |
|
|
chips LL
|
PostPosted: Tue Dec 08, 2009 12:03 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
ya hhehehe I did that and got this weird error, i basically got it down to 1 error on visual C++ 2k6 but on 2k8 (i have on this comp) ill probably get more,,
anyway im not worried about it on 2k8,,
but ya hold on, it wont compile on 2k8 for some reason, i have a head ache lol f*** it its ok ill just ask the teacher right b4 i hand it in
_________________ king of the run on sentence.
|
|
Top |
|
|
chips LL
|
PostPosted: Tue Dec 08, 2009 9:03 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
1>Compiling...
1>as 1.cpp
1>g:\as 1\as 1.cpp(16) : error C2447: '{' : missing function header (old-style formal list?)
1>Build log was saved at "file://g:\as 1\Debug\BuildLog.htm"
1>as 1 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
nvm have an extra day, its due tomorrow (wensday) when i take my final
_________________ king of the run on sentence.
|
|
Top |
|
|
Wizard_of_Gore
|
PostPosted: Wed Dec 09, 2009 8:23 am |
|
Joined: Sat Dec 18, 2004 8:02 am Posts: 2592
Bot Check: GAMER
Website: http://jizaboz.com
Location: USA
|
That's just a syntax error. You'll get it.
_________________ Ultima avatar: The Famed JIZABOZ,GWAR Guildmeister
|
|
Top |
|
|
chips LL
|
PostPosted: Wed Dec 09, 2009 1:16 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
but how do i fix it! lol hurry up and tell me! cuz i gotta go to college later! in like 2hours but i can check while there so post post post how to fix! lol
_________________ king of the run on sentence.
|
|
Top |
|
|
Wizard_of_Gore
|
PostPosted: Wed Dec 09, 2009 2:08 pm |
|
Joined: Sat Dec 18, 2004 8:02 am Posts: 2592
Bot Check: GAMER
Website: http://jizaboz.com
Location: USA
|
LOL Yr not giving me much to work with here... would be nice to actually see yr code in CODE tags so I could count the lines.
All I can say is maybe look the program over and make sure you don't have any { brackets open that don't close somewhere else. That can commonly give that error.
_________________ Ultima avatar: The Famed JIZABOZ,GWAR Guildmeister
|
|
Top |
|
|
chips LL
|
PostPosted: Wed Dec 09, 2009 2:19 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
nope that gives the error
unexpected end-of-file actually, and not unided function header
_________________ king of the run on sentence.
|
|
Top |
|
|
Wizard_of_Gore
|
PostPosted: Wed Dec 09, 2009 4:26 pm |
|
Joined: Sat Dec 18, 2004 8:02 am Posts: 2592
Bot Check: GAMER
Website: http://jizaboz.com
Location: USA
|
You still haven't given me your code in CODE tags so I can match your error with the line lol
Fugit, headed out to the GWAR show!
GWARRRRRRRRRRR
(Good luck BTW )
_________________ Ultima avatar: The Famed JIZABOZ,GWAR Guildmeister
|
|
Top |
|
|
chips LL
|
PostPosted: Wed Dec 09, 2009 7:47 pm |
|
Joined: Mon Mar 12, 2007 6:50 pm Posts: 5732
Bot Check: GAMER
Yahoo Messenger: chipsll
|
lmao my fault, i figured it b4 i went,
i gave values to variables outside of
Main () or w,e
so i declared them kinda twice in a way
_________________ king of the run on sentence.
|
|
Top |
|
|
asd123
|
PostPosted: Thu Jan 07, 2010 11:54 pm |
|
Joined: Thu Jan 07, 2010 11:40 pm Posts: 1
Bot Check: GAMER
|
Essentially, the burritos I make, Have all of the ingredients above, horded onto one flour tortilla.
It's pretty good, but also shoots through you
I'm a lame spam bot and need to be permanently banned by a Forum Administrator.
(Ad link deleted, but I thought the message was hilarious) - Koldoon
|
|
Top |
|
|