Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,257 Programmers. There are 2,037 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

GPA Calculator

 
Reply to this topicStart new topic

GPA Calculator, HELP PLEASE

p0oper89
post 6 May, 2008 - 05:19 PM
Post #1


New D.I.C Head

*
Joined: 6 May, 2008
Posts: 3



Please help with the following program.

This program will allow you to calculate your GPA for one semester. After receiving an explanation of the program and entering the semester, the student will be allowed to enter as many courses as he/she sees fit. The program must then calculate and display the GPA earned for that semester.

In order to produce the GPA, several calculations are needed. For each course, the number of credits, multiplied by the grade point earned in that class, results in a value known as quality points. To calculate the GPA, the total number of quality points for the semester is divided by the total number of credits taken that semester, exclusive of credits for courses taken with the Pass/Fail grading method. Your program should NOT handle Pass/Fail courses at all. The only acceptable grade points are in the range of 0 through 4, where 4 is an A, 3 a B, 2 a C, 1 a D and 0 an F. So, for example, if you took one 4 credit course and received a B, your GPA for that semester would be:

4 credits * 3 points = 12 quality points
12 total quality points / 4 total credits = 3.000 GPA


If there is more than one course, you just keep adding the quality points to the total points and credits to the total credits.

To begin the program , you should print a message to the user explaining what the program does. Then you should ask the user to enter the semester. After these initial steps, you should begin asking the user to enter the number of credits and grade points for each course, one course at a time. The user should enter a -1 as the number of credits to end the input phase. So -1 is the sentinel value for this exercise. At this point a report should be generated that shows the total number of credits taken, the total quality points earned, and the GPA for the semester.

Your program must generate all of the same information as shown in the sample output. You do not need to match the output exactly, however the GPA should be shown to three decimal places. You may also use the data shown here to test your program for accuracy.

More Requirments and details:
* You are REQUIRED to use the following functions exactly as they are given:
o function PrintExplanation(){} - This function should display a description of the program to the user. It should let the user know the specific points values for each of the letter grades. You should print the explanation using an alert(). The function should not return anything.
o function GetValidInput(promptString, sentinel){} - This function takes two arguments: the string that contains the prompt you want to print and the sentinel, which is -1 in this program. You should ask the user for the number and then error check to make sure the number is either greater than 0 or equal to -1. As long as the number the user enters is less than or equal to 0 and not equal to the sentinel, it should continue to prompt for a new number. The function should return the valid number. The function should be general and not mention anything about credits.
o function GenerateGradeReport(semester, totalCredits, totalPoints){} - This function should display the grade report to the user. You should use document.write() to produce the report. You will make a call to the function CalculateGPA() from within this function. The function should not return anything.
o function CalculateGPA(totalCredits, totalPoints){} - This function simply performs the GPA calcuation. It should return the calculated GPA.
* You should use the GetValidInput() function to get the number of credits from the user.
* You do not have to error check the points. You can assume the user will only type 4, 3, 2, 1 or 0.
* Feel free to add any style you would like to the GPA Report.

THANK YOU IN ADVANCE!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


PsychoCoder
post 6 May, 2008 - 06:05 PM
Post #2


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,857

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

p0oper89
post 7 May, 2008 - 11:43 AM
Post #3


New D.I.C Head

*
Joined: 6 May, 2008
Posts: 3

QUOTE(PsychoCoder @ 6 May, 2008 - 06:05 PM) *

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.



You useless. Obviously you do not know how to write this code. Go fuck ur self. Bye
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

BenignDesign
post 7 May, 2008 - 12:14 PM
Post #4


D.I.C Regular

Group Icon
Joined: 28 Sep, 2007
Posts: 484

Well, he was a perky fellow, wasn't he?
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Nykc
post 7 May, 2008 - 01:10 PM
Post #5


DIC == Huge!

Group Icon
Joined: 14 Sep, 2007
Posts: 2,293

He double posted and is pissed no one will do it for him rofl.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

PsychoCoder
post 7 May, 2008 - 01:26 PM
Post #6


ToCode || !ToCode

Group Icon
Joined: 26 Jul, 2007
Posts: 5,857

QUOTE(p0oper89 @ 7 May, 2008 - 11:43 AM) *

You useless. Obviously you do not know how to write this code. Go fuck ur self. Bye


Dude, I could write this in my sleep, but I'm not doing your work for you lazy ass smile.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:47AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month