Sponsored Content
Full Discussion: Grade Score Script Project
Top Forums Shell Programming and Scripting Grade Score Script Project Post 302298383 by lazypeterson on Tuesday 17th of March 2009 11:26:25 AM
Old 03-17-2009
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!
 

7 More Discussions You Might Find Interesting

1. Solaris

SSH doesn't pick up user's project from /etc/project

We have a system running ssh. When a user logs in, they do not get the project they are assigned to (they run under "system"). I verify the project using the command "ps -e -o user,pid,ppid,args,project". If you do a "su - username", the user does get the project they are assigned to (and all... (2 Replies)
Discussion started by: kurgan
2 Replies

2. Post Here to Contact Site Administrators and Moderators

I cant updated the score on space invaders

Hello The same thing happen to me yesterday I can´t record my score on invaders game. (0 Replies)
Discussion started by: lo-lp-kl
0 Replies

3. Shell Programming and Scripting

remove lines based on score criteria

Hi guys, Please guide for Solution. PART-I INPUT FILE (has 2 columns ID and score) TC5584_1 93.9 DV161411_2 79.5 BP132435_5 46.8 EB682112_1 34.7 BP132435_4 29.5 TC13860_2 10.1 OUTPUT FILE (It shudn't contain the line ' BP132435_4 29.5 ' as BP132435 is repeated... (2 Replies)
Discussion started by: smriti_shridhar
2 Replies

4. News, Links, Events and Announcements

A new project was posted on The UNIX and Linux Forums project board.

A new project was posted on your project board. Project title: Bash Shell Tutoring Estimated Budget: $50/hr Start date: Immediately Required skills: Linux, Bash, Shell, UNIX I work as a datawarehouse designer and developer. Although I usually stick to the role of an analyst,... (0 Replies)
Discussion started by: Neo
0 Replies

5. Shell Programming and Scripting

Split a file in more files based on score content

Dear All, I have the following file tabulated: ID distanceTSS score 8434 571269 10 10122 393912 9 7652 6 10 4863 1451 9 8419 39 2 9363 564 21 9333 7714 22 9638 8334 9 1638 1231 11 10701 918 1000 6587 32056 111 What I would like to do is the following, create 100 new files based... (5 Replies)
Discussion started by: paolo.kunder
5 Replies

6. Shell Programming and Scripting

Average score

awk '{if(len==0){last=$4;total=$6;len=1;getline}if($4!=last){printf("%s\t%f\n", last, total/len);last=$4;total=$6;len=1}else{total+=$6;len+=1}}END{printf("%s\t%f\n", last, total/len)}' exon.txt > output.txt In the attached file I am just trying to group all the same names in column $4 and then... (2 Replies)
Discussion started by: cmccabe
2 Replies

7. UNIX for Dummies Questions & Answers

Mean score value by ID over a defined genomic region

Hi, I would like to know how can I get a mean score value by ID over a defined genomic region. Here it is an example: file1 12 100 103 id1 12 110 112 id1 12 200 203 id2 file2 12 100 101 1 12 101 102 0.8 12 102 103 0.7 12 110 111 2.5 12 111 112 2.8 12 200 201 10.1 12 201 202... (7 Replies)
Discussion started by: fadista
7 Replies
FULLQUOTTEL(1)							   User Commands						    FULLQUOTTEL(1)

NAME
fullquottel - tool for detecting full quotes in mails or postings SYNOPSIS
fullquottel [OPTION...] < infile > outfile DESCRIPTION
fullquottel - tool for detecting full quotes in mails or postings -t, --scorethreshold=NUMBER Threshold for final score that discriminates between Goodquottel and Fullquottel (default: 1.5) --quotechars=CHARS Chars used for quoting (default: >|#) -d, --debug Debug option (prints single test results; default: off) --ownsigtest=1|0 Turn on/off ownSigTest (default: on) --ownsigtestscore=NUMBER Score for ownSigTest (default: 1.0) -f, --ownsigtestfile=SIGFILE Signature file to test against (default: ~/.signature) --mstest=1|0 Turn on/off msTest (Microsoft attribution lines; default: on) --mstestscore=NUMBER Score for msTest (default: 1.0) --mstestthreshold=NUMBER Threshold for msTest (at or below which line a Microsoft attribution line ist found; default: 2) --quotedtoalltest=1|0 Turn on/off quotedToAllTest (ratio quoted lines to all; default: on) --quotedtoalltestscore=NUMBER Score for quotedToAllTest (default: 1.0) --quotedtoalltestfactor=NUMBER Result = score + ratio * FACTOR (default: 0) --quotedtoalltestthreshold=NUMBER Ratio threshold for activating quotedToAllTest (default: 0.5) --bottomquotedtoalltest=1|0 Turn on/off bottomQuotedToAllTest (ratio quoted lines at bottom to all; default: on) --bottomquotedtoalltestscore=NUMBER Score for bottomQuotedToAllTest (default: 1.0) --bottomquotedtoalltestfactor=NUMBER Result = score + ratio * FACTOR (default: 0) --bottomquotedtoalltestthreshold=NUMBER Ratio threshold for activating bottomQuotedToAllTest (default: 0.5) --bottomquotedtoquotedtest=1|0 Turn on/off bottomQuotedToQuotedTest (ratio quoted lines at bottom to all quoted lines; default: on) --bottomquotedtoquotedtestscore=NUMBER Score for bottomQuotedToQuotedTest (default: 1.0) --bottomquotedtoquotedtestfactor=NUMBER Result = score + ratio * FACTOR (default: 0) --bottomquotedtoquotedtestthreshold=NUMBER Ratio threshold for activating bottomQuotedToQuotedTest (default: 0.5) --singlebottomquotetest=1|0 Turn on/off singleBottomQuoteTest (only one quote block, and at the bottom; default: on) --singlebottomquotetestscore=NUMBER Score for singleBottomQuoteTest (default: 1.0) HINT: All long options (without leading --) can be used in ~/.fullquottelrc -?, --help Give this help list --usage Give a short usage message -V, --version Print program version Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. REPORTING BUGS
Report bugs to <toast@toastfreeware.priv.at>. SEE ALSO
The full documentation for fullquottel is maintained in HTML created by doxygen and can be found in /usr/share/doc/fullquottel/html/ fullquottel 0.1.2 April 2007 FULLQUOTTEL(1)
All times are GMT -4. The time now is 09:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy