The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
remove lines based on score criteria smriti_shridhar Shell Programming and Scripting 2 12-02-2008 01:03 AM
A small project with bash script and craigslist hexpill Shell Programming and Scripting 0 11-25-2008 08:51 AM
I cant updated the score on space invaders lo-lp-kl Post Here to Contact Site Administrators and Moderators 0 06-26-2008 02:35 PM
Open source gets an "A" grade at UniversityReaders iBot UNIX and Linux RSS News 0 05-22-2008 05:30 PM
Learning to script...want a project to work on (making a small MUD) learningtoscrip UNIX for Dummies Questions & Answers 2 10-24-2001 01:15 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-17-2009
lazypeterson lazypeterson is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 13
Grade Score Script Project

What I thought would be an extremely simple project has proven more difficult for me than I thought. Here are the parameters:

Quote:
Write a script to calculate the total score and assign a letter grade for each student
(source data is in the file “grades”). Output the all students’ name, scores, and grades
in descending order of the total score. Note: please save the output to the file
“finalgrades.txt”.

Format of source data file (grades.txt):
Name Exam1 Exam2 Exam3

Content of source data file (grades.txt):
Tom 23 12 15
Jack 30 15 29
Jane 31 25 19

The final letter grade will be determined based on the following criteria:
A 90 and above
B 80 thru 89
C 65 thru 79
D 50 thru 64
F less than 50

Output (finalgrades.txt)
Name Exam1 Exam2 Exam3 Total Grade
Jane 31 25 29 85 B
Jack 30 15 29 74 C
Tom 23 12 15 60 D
Thus far, I've been able to sort the final grades, but I'm having a lot of trouble with appending the correlating letter grade to the end of each line. Any help would be greatly appreciated. Thanks!
  #2 (permalink)  
Old 03-17-2009
va2206 va2206 is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 7
Looks like a homework..

Thanks
Sha
  #3 (permalink)  
Old 03-17-2009
lazypeterson lazypeterson is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 13
Yes, it is.
  #4 (permalink)  
Old 03-17-2009
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
Homework posts are against the rules.
Thread closed!
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:22 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0