»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 12-23-2003, 11:47 AM   #1 (permalink)
Registered User
 
Join Date: Dec 2003
Posts: 5
fehyando is on a distinguished road
I need a hlep in c++

hey guys
i a new member and i need a help in c++ ,I have a project in array
this project about student and grades.
first must show a choise as following:
1)add grade for a new student.
2)update grade for a student .
3)Display grade of a Student.
4)Display grade for all Students
5)Sorting grade of a Student
6)Sorting Student by a verage
7)Exit.
please help me

fehyando is offline   Reply With Quote
Old 12-23-2003, 11:52 AM   #2 (permalink)
Registered User
 
Join Date: Dec 2003
Posts: 5
fehyando is on a distinguished road
#include<iostream.h>
this is begin
int main()
{
int x,student=0,i=100, n=0;
const int j=5;
float a[j];
first : cout<<"Chose form this option:\n\n";
cout<<"1)Add grade for new a Student\n\n";
cout<<"2)Update grade for a Student\n\n";
cout<<"3)Display grade of a Student\n\n";
cout<<"4)Display grade for all Students\n\n";
cout<<"5)Sorting grade of a Student\n\n";
cout<<"6)Sorting Student by a verage\n\n";
cout<<"7)Exit\n\n";
cout<<"choise is :";
cin>>x;
while (true)
{
switch (x)
{
case 1:

break;
case 2:
case 3: break;
case 4:
break;
case 5:
case 6:
break;
case 7:return 0;
default:cout<<"This is wrong Chois,,, Try again\n";
break;
}
goto first;
}
}
fehyando is offline   Reply With Quote
Old 12-23-2003, 12:05 PM   #3 (permalink)
Registered User
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,527
crouse is on a distinguished road
Send a message via ICQ to crouse
hmmmm looks like a homework project to me
__________________
The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners. --- Author Unknown.
crouse is offline   Reply With Quote
Old 12-23-2003, 12:19 PM   #4 (permalink)
Registered User
 
Join Date: Dec 2003
Posts: 5
fehyando is on a distinguished road
can you help me
fehyando is offline   Reply With Quote
Old 12-23-2003, 06:37 PM   #5 (permalink)
Registered User
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 522
squeech is on a distinguished road
Hehe, we're not really supposed to do those
__________________
Talking in numbers doesn't make you smarter.
squeech is offline   Reply With Quote
Old 12-23-2003, 06:49 PM   #6 (permalink)
Registered User
 
Join Date: Oct 2001
Location: NC in the US
Posts: 3,732
Redwolf is on a distinguished road
Send a message via ICQ to Redwolf Send a message via AIM to Redwolf Send a message via Yahoo to Redwolf
Code:
#include<stdio.h>
main()
{
printf("I didn't do my homework last night");
printf("\nSo c'mon and give me that big fat F I deserve!");
printf("\nOh, and did I mention my professor is such a moron!);
printf("\nHaha!  Stupid professor!");
return 0;
}

Last edited by Redwolf; 12-23-2003 at 07:01 PM.
Redwolf is offline   Reply With Quote
Old 12-23-2003, 06:50 PM   #7 (permalink)
Registered User
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 522
squeech is on a distinguished road
First of all...Welcome to TechIMO!!

Here's a few conceptual thoughts to get you started despite our lax little guideline...

--Adding a grade for a student is basically taking a value (cin) and setting it equal to that student's spot in the array (a[0]=x) (each student seems to be represented by and array index 0-5, or six students total).

--Updating is the same process of code.

--Displaying a grade can be a simple cout statement (student [index] has [value] in the class). While displaying the values for all students is the same thing but in some sort of for/while loop running through a number of times equal to the number of students.

--Sorting...there are hundreds of easy ways to do this. The simplest was would be to do some sort of a bubble sort on your array of student grades (look up bubble sort on google to get some code or pseudocode for the algorithm...it's not difficult to figure out).


BTW, goto is not a command recognized in C++, but rather in BASIC and FORTRAN (i think...)

~edit: LOL Redwolf that's not friendly
__________________
Talking in numbers doesn't make you smarter.
squeech is offline   Reply With Quote
Old 12-23-2003, 07:00 PM   #8 (permalink)
Registered User
 
Join Date: Oct 2001
Location: NC in the US
Posts: 3,732
Redwolf is on a distinguished road
Send a message via ICQ to Redwolf Send a message via AIM to Redwolf Send a message via Yahoo to Redwolf
No, but it is fun


I'd help you. but all I know is C
Redwolf is offline   Reply With Quote
Old 12-24-2003, 11:51 AM   #9 (permalink)
Registered User
 
Join Date: Dec 2003
Posts: 5
fehyando is on a distinguished road
Systems

thank you for all......
But i really need more help..
fehyando is offline   Reply With Quote
Old 12-24-2003, 01:13 PM   #10 (permalink)
Registered User
 
Join Date: Dec 2003
Posts: 5
fehyando is on a distinguished road
this is work form 1 to 4 for choise
and No error but Bad work i do not know a reson


void addgrade (int m[student][exams])
{

static int sum =0;

for (int i=0;i<student;i++)
{
cout<<"\n Enter grade for student numbers:"<<sum+1<<endl;
for(int j=0;j<exams;j++)
{
cin>>m[i][j];

}
sum+=1;
break;
}
}
void updategrade (int m[student][exams],int f)
{


m[f][exams];
for (int i=0;i<student;i++)
{
cout<<"\n Enter grade for student numbers:"<<f<<endl;
for(int j=0;j<exams;j++)
{
cin>>m[i][j];

}

break;
}
}
void displayone (int m[][exams],int k)
{
m[k][exams];
for(int j=0;j<exams;j++)
{
cout<<m[k][j]<<endl;

}

}
void displayall(int grade[student][exams])
{
for(int i=0;i<student;i++)
for(int j=0;j<exams;j++)
cout<<grade[i][j];
}
fehyando is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 12:20 PM.