Computing.Net > Forums > Programming > Can anyone help me w/ C++?

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Can anyone help me w/ C++?

Reply to Message Icon

Original Message
Name: Alex
Date: September 18, 2002 at 08:05:41 Pacific
Subject: Can anyone help me w/ C++?
OS: WinXP
CPU/Ram: AMD/Athlon/512
Comment:

I am trying to learn C++, I was given this program to write out. Can anyone write this? I will type this exactly what was given to me:

"Write a program to read a student's school id number, his old GPA(grade point average), and old number of course credits (for example,34573,3.5,45), and then print these with appropriate labels. Finally, read in the course credit and grade for each of four courses; for example, Course1=3, Grade1=3.2, Course2=4, Grade2=3.5, Course3=2, Grade3=4.0, Course4=4, Grade4=3.5. Calculate:

old # of honor points=(old#of course credits)*(old GPA)

new # of honor points=Course1*Grade1+Course2*Grade2+Course3*Grade3+Course4*Grade4

current GPA = #of new honor points / #of new course credits

Print the current GPA with appropriate lables. Then calculate

cummulate GPA = (#of old honor points)+(#of new honor points) / (#of old courses credits)+(#of new course credits)

and print this with a label. "
I hope you guys can help me out on this one. Thanks



Report Offensive Message For Removal


Response Number 1
Name: Mark
Date: September 18, 2002 at 08:52:02 Pacific
Reply: (edit)

Hi-

Show me what you have so far and I will help you. I do not think this forum is used for solving homework problems with a little effort on your part.

-Mark


Report Offensive Follow Up For Removal

Response Number 2
Name: Alex
Date: September 18, 2002 at 19:18:18 Pacific
Reply: (edit)

No mark its not an assignment. The only thing i was having trouble was trying to have "Enter Students name and then Enter Students id number, but after running it the "enter students name and enter students id number" were together on one line. How can i have them both on seperate lines. When i wrote in the beginning, i entered,

Char sn; //student name
Char sidn; //student id number.
I then entered below the main(),

cout>sn;
cout>sidn;
What am i doing wrong?


Report Offensive Follow Up For Removal

Response Number 3
Name: Jason Rodgers
Date: September 19, 2002 at 13:00:44 Pacific
Reply: (edit)

First off you can't put a name into a single "char", you will have to do some type of array on that char

Second the 'cout' command should look like

cout<


Report Offensive Follow Up For Removal

Response Number 4
Name: Jason Rodgers
Date: September 19, 2002 at 13:02:22 Pacific
Reply: (edit)

The cout command on the last reply should have two less than signs then the sn.

For some reason this form will not show them.



Report Offensive Follow Up For Removal

Response Number 5
Name: Alex
Date: September 19, 2002 at 20:01:26 Pacific
Reply: (edit)

Thanks Jason for your input. alex


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you own an iPhone?

Yes
No, but soon
No


View Results

Poll Finishes In 7 Days.
Discuss in The Lounge
Poll History




Data Recovery Software