473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Grade Array Program!

5 New Member
I'm a beginner to C++ programming I have this assignment I need help with!!!!

Create a program that will allow the user to enter 10 grades. After those 10 grades are entered, your program should curve all grades based upon the highest grade entered.

Display the new grades.

How do I go about doing this?
Nov 2 '07 #1
6 6623
Ganon11
3,652 Recognized Expert Specialist
What part are you having trouble with?
Nov 2 '07 #2
Corn0006
5 New Member
How to set up an input for the arrays? And the concept of the rest of the program
Nov 2 '07 #3
oler1s
671 Recognized Expert Contributor
You'll need to know how to use loops.
Nov 3 '07 #4
Corn0006
5 New Member
This what I have so far, what's wrong with this?
Expand|Select|Wrap|Line Numbers
  1. //Arrays: Grades w/out lowest grade.
  2.  
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double grades[10];
  9.     double total_points = 0;
  10.     double curve = 0;
  11.     double lowest_score = 100;
  12.  
  13.  
  14.     for(int i=0; i<10; i++)
  15.     {
  16.             grades[i] = 0;
  17.     }
  18.  
  19.     for(int i=0; i<10; i++)
  20.     {
  21.             cout << "\nPlease enter Grade #" << i+1 << ": ";
  22.             cin >> grades[i];
  23.             if(grades[i] < lowest_scr)
  24.             {
  25.                         lowest_score = grades[i];
  26.             } 
  27.     }
  28.  
  29.     for(int i=0; i<10; i++)
  30.     {
  31.             total_points = total_points + grades[i];
  32.     }
  33.  
  34.  
  35.  
  36.     curve = (total_pts - lowest_score) / 9;
  37.  
  38.     cout << "The average grade is...." << average;
  39.  
  40.     cin.ignore(256,'\n');
  41.     cin.get();
  42. }
Nov 3 '07 #5
sicarie
4,677 Recognized Expert Moderator Specialist
This what I have so far, what's wrong with this?
We have no idea, what is wrong with that? Are you getting an error? If so, please post it. Are you having a logical error (output not what you expected)? If so, post what it is and what you want it to be.
Nov 3 '07 #6
r035198x
13,262 MVP
This what I have so far, what's wrong with this?
Expand|Select|Wrap|Line Numbers
  1. //Arrays: Grades w/out lowest grade.
  2.  
  3. #include<iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double grades[10];
  9.     double total_points = 0;
  10.     double curve = 0;
  11.     double lowest_score = 100;
  12.  
  13.  
  14.     for(int i=0; i<10; i++)
  15.     {
  16.             grades[i] = 0;
  17.     }
  18.  
  19.     for(int i=0; i<10; i++)
  20.     {
  21.             cout << "\nPlease enter Grade #" << i+1 << ": ";
  22.             cin >> grades[i];
  23.             if(grades[i] < lowest_scr)
  24.             {
  25.                         lowest_score = grades[i];
  26.             } 
  27.     }
  28.  
  29.     for(int i=0; i<10; i++)
  30.     {
  31.             total_points = total_points + grades[i];
  32.     }
  33.  
  34.  
  35.  
  36.     curve = (total_pts - lowest_score) / 9;
  37.  
  38.     cout << "The average grade is...." << average;
  39.  
  40.     cin.ignore(256,'\n');
  41.     cin.get();
  42. }
Check the error messages that you are getting.
You are abbreviating your variable names at some points ...total_pts, lowest_scr
Nov 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

35
by: Henry | last post by:
I was doing this program for an exercise in a book. The point was to create a program that would take a numerical grade from a user and convert it to a letter grade (yeah really easy). I tried to...
1
by: sparkid | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to...
2
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
14
by: xtheendx | last post by:
I am writing a gradbook type program. It first allows the user to enter the number of students they want to enter. then allows them to enter the first name, last name, and grade of each student. The...
3
by: blamp | last post by:
I have completed most of the program I just cant get the letter grade to print from the void printGrade function.The output of the program should be: Line 1: Based on the course score, this...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.