..How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ..How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script
# 1  
Old 11-06-2011
..How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script

Hi guys,

I have a problem....How to add these all ( 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25) in the script and How to calculate the GPA??Smilie

For example a course record file can be like this:

COURSE NAME: Operating Systems
CREDITS: 4
123456 1 1 0 1 1 0 1 0 0 0 1 5 8 0 12 10 25
243567 0 1 1 0 1 1 0 1 0 0 0 7 9 12 15 17 15

create a file in the directory which contains the list of all students, their total marks for each course, and their GPA as the last column.

Student# <course name> <course name> <course name> …

For example a GPA file could be like this:

Student# Operating Systems JAVA C++ Web Development GPA
123456 76 63 50 82 67.75
243567 80 - 34 63 59


Last edited by radoulov; 11-06-2011 at 12:43 PM.. Reason: Homework!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

How to add \ in front of $ in a script with vi?

Please help to provide command in vi to add \ in front of $ so it does not interpret next character. rm interfaces/DART/WEB-INF/classes/DART/util/TotalDisconnectUtil$1.class rm interfaces/DART/WEB-INF/classes/DART/util/TotalDisconnectUtil$2.class rm... (3 Replies)
Discussion started by: ywu081006
3 Replies

2. Shell Programming and Scripting

Script to add columns

I want to add all the columns in the file below 1 4 5 6 2 7 8 9 6 7 9 5 Output: 1+2+6 4+7+7 5+8+9 6+9+5 Any suggestions will be appreciated. Thank you (5 Replies)
Discussion started by: web2moha
5 Replies

3. Solaris

Any script to add IP's in zone ?

I have a Solaris-11 box, which is hosting 3 non-global zones. I am going to add 38 IP address to each zones (144 for all three zones). I kept those IP addresses in three files - /tmp/zone1_ip is having all ip's which needs to add in zone1, /tmp/zone2_ip is having ip's for zone2 and /tmp/zone3_ip... (2 Replies)
Discussion started by: solaris_1977
2 Replies

4. Shell Programming and Scripting

how to write a script to add

HI Team, I have requirement as below: i have generated two csv files into separate files but that files should be in a single with separate tab in the sheet. Please help me out ,how to do in the unix shell scripting. Thanks in Adavance (2 Replies)
Discussion started by: lnviyyapu
2 Replies

5. Shell Programming and Scripting

Script to add extension to filename

Hi all, I have a folder with a bunch of files in them, and I would like to add an extension (.mp3)to all these filenames. The folder has only files that I'd like .mp3 added to. It looks something like this: Intput: File1 File2 File3Output: File1.mp3 File2.mp3 File3.mp3Thanks in... (2 Replies)
Discussion started by: repiv
2 Replies

6. Shell Programming and Scripting

How to add a script to Crontab?

Hi! We are on AIX 5.3 I have a script that must be run once every hour. How do i add this to the crontab? I know how to access crontab which is, crontab -e. What do i do after that ? If i have the path to the script? Thank you!!! (4 Replies)
Discussion started by: atechcorp
4 Replies

7. Shell Programming and Scripting

add variable to script

Hello i am creating script to do some process and i need to add variable to the script before it runs so inside the script is should wait for variable with &&id and while running script i should write down this id example: ./script.sh 2938 how this can be implemnted? regards (1 Reply)
Discussion started by: mogabr
1 Replies

8. Shell Programming and Scripting

add not equal in script.

Hi, i just want to print the value which are not equal. I try with $str != ${comp2} but still getting same values. for str in ${comp1}; do i=0 while (( $i < ${#comp2} )); do if } ]]; then print value here. break fi (( i += 1 )) done done... (2 Replies)
Discussion started by: myguess21
2 Replies

9. Shell Programming and Scripting

Add new data using script

Hi All, I have a list of data in one file. For example, in the file test.lst, the data as below; abcd efgh ijkl mnop qrst Instead of using vi, how i can write a script if i want to add new data "uvwx" in the test.lst Kindly guide me. -malaysoul- (1 Reply)
Discussion started by: malaysoul
1 Replies

10. Shell Programming and Scripting

script for add and subtract two hours

i find a script to calculate hours of job i(nclude extraordinary) i make a script to calculate add and subtract two hours (format hh:mm:ss) (7 Replies)
Discussion started by: ZINGARO
7 Replies
Login or Register to Ask a Question