home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

I need a hlep in c++

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2653
Discussions: 200,998, Posts: 2,379,966, Members: 246,365
Old December 23rd, 2003, 02:47 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Dec 2003
Posts: 5
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 December 23rd, 2003, 02:52 PM     #2 (permalink)
Junior Member
 
Join Date: Dec 2003
Posts: 5
#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 December 23rd, 2003, 03:05 PM     #3 (permalink)
Ultimate Member
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,879
Send a message via ICQ to crouse
hmmmm looks like a homework project to me
__________________
USA Linux Users Group
OpenSUSE.us
crouse is offline   Reply With Quote
Old December 23rd, 2003, 03:19 PM     #4 (permalink)
Junior Member
 
Join Date: Dec 2003
Posts: 5
can you help me
fehyando is offline   Reply With Quote
Old December 23rd, 2003, 09:37 PM     #5 (permalink)
Senior Member
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 613
Hehe, we're not really supposed to do those
__________________
Talking in numbers doesn't make you smarter.
squeech is offline   Reply With Quote
Old December 23rd, 2003, 09:49 PM     #6 (permalink)
Leader of the Crab People
 
Redwolf's Avatar
 
Join Date: Oct 2001
Location: NCSU
Posts: 4,381
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 : December 23rd, 2003 at 10:01 PM.
Redwolf is offline   Reply With Quote
Old December 23rd, 2003, 09:50 PM     #7 (permalink)
Senior Member
 
squeech's Avatar
 
Join Date: May 2002
Location: Rocky Mountain High
Posts: 613
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
squeech is offline   Reply With Quote
Old December 23rd, 2003, 10:00 PM     #8 (permalink)
Leader of the Crab People
 
Redwolf's Avatar
 
Join Date: Oct 2001
Location: NCSU
Posts: 4,381
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 December 24th, 2003, 02:51 PM     #9 (permalink)
Junior Member
 
Join Date: Dec 2003
Posts: 5
Unhappy

thank you for all......
But i really need more help..
fehyando is offline   Reply With Quote
Old December 24th, 2003, 04:13 PM     #10 (permalink)
Junior Member
 
Join Date: Dec 2003
Posts: 5
Thumbs down

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (3099)
Charges against non-tippers dropped.. (22)
Health Care Rationing (17)
Foxconn Blackops x48 MoBo (5)
Nvidia GTX 260 problem (14)
Delete an OS (17)
Laptop with wireless problem. (13)
Wireless Televisions. (12)
windows vista security holes (19)
CPU fan stops spinning randomly (11)
Regular Build (11)
Point and Shoot Camera Suggestions. (9)
[F@H SPAM 11/16/09] ! 1/2 months to.. (41)
windows 7 problem (7)
Recent Discussions
Delete an OS (18)
Outputing 1080p from my PC to my 720p.. (0)
panasonic dmr ez48veb recorder (0)
add ram to existing (3)
Need help getting speakers to work (2)
Nvidia GTX 260 problem (14)
Laptop with wireless problem. (13)
Point and Shoot Camera Suggestions. (9)
Is the PSU I received dead? (16)
FreeAgent drive software not x64 comp.. (1)
Intel 5100 AGN issues fixed yet? (28)
Foxconn Blackops x48 MoBo (5)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (41)
Print spooler problem (17)
Q9650 vs. Q9550 (2)
Desktop Calendar Application (2)
Looking for new motherboard (1)
soundmon.exe (8)
Jedi Academy Problem (3)
Can a page file be "too big".. (1)
Size after cutting 700Mb file is 2.5 .. (0)
windows vista security holes (19)
updating BIOS via winflash, claims fi.. (1)
New Server Configuration Suggestions (0)
cheap gaming laptop? (12)


All times are GMT -4. The time now is 12:33 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28