473,320 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

help in reading test scores and writing to file

Hi all,

I just joined the post. Iam new to C programming. I have a question regarding a problem for my assignment. The problem is i have a input file with student ID, 5 program scores, midterm and final score. i have to check for wrong input of data(negative score),calculate average score for program,calculate student totalscore (30% of programming,30% midterm,35%final and 5%free for whoever takes final exam),give grade to student and then finally compute calss total score.

print in a format (sID,ps1,ps2,ps3,ps4,ps5,midterm,final,total, grade) to the output file.

My idea looks very simple to the problem. I think it may not that simple as i think. Please guide me.

-First we have to scan the details from input file
-if the score is > 0 and < 100 then
1)calculate average score for programs (total all score and divide by 5)
2) student total score i.e 30%*total program score+35%midterm+35%*final+5%
Else
display "the score is not a valid one"
3)calculating grade
If Marks >=90 and <=100 then
Display grade = ‘A’

Else if marks >= 80 and <=89 then
Display grade = ‘B’

Else if marks >= 70 and <=79 then
Display grade = ‘C’

Else if marks >= 60 and <=69 then
Display grade = ‘D’

Else if marks >=0 and <=59 then
Do display grade = ‘F’

4) calculate total class score

Please let me know if iam right. If possible please tell me how to start writing C code for this or the pseudocode. Im really confused how to start and what to use.I did write a program for this but that doesn't look right. Please help me

Thanks for your help
Oct 14 '06 #1
0 2109

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

Similar topics

0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
36
by: felixnielsen | last post by:
What i really wanna do, is defining my own types, it doesnt really matter why. Anyway, i have run into some problems 1) typedef unsigned short U16; U16 test = 0xffffffff; // There should be a...
1
by: bigcountry2819 | last post by:
I have gotten through the first half of the semester fine but we got a new assignment in my class the other day and I am completely lost on what to do. The assignment is: Write a program that...
3
by: Beginner01 | last post by:
I need some help reading in a file that has a column with the student's name and then a column with their score. I need to input this into 2 seperate arrays. One for the names and one for the...
0
by: sentinelfire | last post by:
I dont know anything about bowling.I have to write four functions findpattern, countrange, validset and classify. findpattern will receive three scores countranges will receive the three scores...
1
by: mastern200 | last post by:
I need some homework help with an assignment due wed. I need to make a program where in this program calculates the average of a set of test scores. The program will ask the user how many scores...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: laila2ethan | last post by:
Need someones help , I am having a very difficult time understanding parameters and functions, can someone help me answer these questions 1. Write a program that helps an elementary school student...
1
by: payalp | last post by:
(1) Reads from the file “hw4.txt” in the local directory the SID (which is a string) and the scores (which are integers) of each student in a class. Although the number of students and the number of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.