C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 29th, 2009, 08:37 PM
CPNewb CPNewb is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Posts: 1 CPNewb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 51 sec
Reputation Power: 0
General - Help writing a program

Ok, first and foremost, let me first apologize for posting this, because I almost guarantee that there is prob. loads of other topics with very similar questions asked regarding the same type of thing. However, I am in a HURRY, this program is due tonight at midnight (it's currently around 8:30 p.m. where I live), so any help would be GREATLY appreciated.

Anyways, the program we're supposed to be designing is a loop. I have a terrible teacher, who hasn't taught me a damn thing, and I really need to learn and grasp the concepts with this because I'm going to major in Computer Science.

So here goes. First, we can't use any array or functions in this. We're supposed to develop a program for a 5th grade teacher that computes students' averages as well as a class average. Class scores being stored in a file. The first line of the file contains the number of test scores per students and the rest are student records. Each record contains a student name and the test scores ranging in value from 0 to 100.

Problem Requirements:
1. Read the number of test scores and student records until the end of file is reached.
2. Compute the average grade for each student
3. Print the letter grade for each student
4. print A if (90 to 100)
5. print B if (80 below 90)
6. print C if (70 below 80)
7. print D if (60 below 70)
8. print F if (below 60)
9. compute and display the average for the class (i.e., the average of the student averages)
10. assume all the scores are valid (between 0 and 100 inclusive)
11. display the output in a table format with a heading
12. display the number of test scores per student and the number of students in the class.

For example, if the input file ola5.2 contains :
3
Tracy 80 91 67
Dana 0 66 44
Scott 50 41 64
Jamie 82 90 87
Jennifer 95 100 90
William 67 77 62
Wendy 90 96 84
Heather 80 91 86
John 100 100 99

Your output may look like :

Please enter the file name that contains the student records: ola5.2
there are 3 scores per student

Student name test1 test2 test3 final score grade

-------------------------------------------------------

Tracy 80 91 67 79.33 C

Dana 0 66 44 36.67 F

Scott 50 41 64 51.67 F

Jamie 82 90 87 86.33 B

Jennifer 95 100 90 95.00 A

William 67 77 62 68.67 D

Wendy 90 96 84 90.00 A

Heather 80 91 86 85.67 B

John 100 100 99 99.67 A


The class average is 77.00
There are 9 students.

As another example, if the input file ola5.2b contains :
4
Tracy 80 91 67 78
Scott 50 41 64 72
Jamie 82 90 87 91
Jennifer 95 100 90 98
William 67 77 62 71
Wendy 90 96 84 95
Heather 80 91 86 84
John 100 100 99 100

Your output may look like :

Please enter the file name that contains the student records: ola5.2b
there are 4 scores per student

Student name test1 test2 test3 test4 final score grade

-------------------------------------------------------------

Tracy 80 91 67 78 79.00 C

Scott 50 41 64 72 56.75 F

Jamie 82 90 87 91 87.50 B

Jennifer 95 100 90 98 95.75 A

William 67 77 62 71 69.25 D

Wendy 90 96 84 95 91.25 A

Heather 80 91 86 84 85.25 B

John 100 100 99 100 99.75 A



The class average is 83.06
There are 8 students.

So basically, I really need help with this. We've basically skipped from the bare basics of C++ right into this in about a week, and I have zero prior experience to actual programming. Help is appreciated, and I'm sure some of you experienced guys can figure this out in a matter of a minutes.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > General - Help writing a program


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek