Thread: C programming Task to calculate the average grades

  1. #1
    Registered User
    Join Date
    Jan 2019

    C programming Task to calculate the average grades

    hello .. can any one help me to solve this problem in c programing please

    You have to prepare the algorithm for the application.
    Your application should do the following:

    1) Read the first name, last name, and four exam grades for each student from the input file “input_File.txt”.

    2) Calculate the average grade for each student.

    3) Find the corresponding letter grade as per the calculated average as the following.

    a. From 90 to 100: A
    b. From 80 to 89.9: B
    c. From 70 to 79.9: C
    d. From 60 to 69.9: D
    e. From 50 to 59.9: F
    f. Below 50: U

    4) Output the students’ first name, last name, average score, and corresponding letter grade in the output file “output_File.txt”.

    The program’s input will look like the following (for example):

    Ali Ahmad 78.3 67.2 72.6 65.2
    Sami Ashraf 45.2 69.6 60.5 71.1
    Mona Abdelghani 98.4 41.2 88.3 90.4
    Samah Mohammad 76.8 74.2 66.8 79.1
    Salem Hani 89.8 84.2 87.5 81.9
    Arwa Farid 55.5 58.4 59.3 52.2
    Salah Naser 97.2 94.1 92.1 91.5

    6) The output for this input file should be as the following

    Ali Ahmad Average: 70.82 Grade: C
    Sami Ashraf Average: 61.60 Grade: D
    Mona Abdelghani Average: 79.58 Grade: C
    Samah Mohammad Average: 74.22 Grade: C
    Salem Hani Average: 85.85 Grade: B
    Arwa Farid Average: 56.35 Grade: F
    Salah Naser Average: 93.72 Grade: A

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    So what do you need help with?

    We're here to guide you, not do your work for you.
    You need to show us what you can achieve by yourself, then we advise on how to fix, improve and move forward.

    > Salem Hani Average: 85.85 Grade: B
    Salem always gets A's.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Trying to calculate a running average
    By knik653 in forum C Programming
    Replies: 18
    Last Post: 11-11-2018, 11:57 AM
  2. Replies: 2
    Last Post: 10-05-2016, 06:37 PM
  3. How to calculate grades using Linked Lists
    By TampaTrinDM88 in forum C Programming
    Replies: 8
    Last Post: 07-13-2009, 09:08 AM
  4. C program using structs to calculate grades
    By TampaTrinDM88 in forum C Programming
    Replies: 4
    Last Post: 07-06-2009, 12:33 PM
  5. calculate average
    By archriku in forum C Programming
    Replies: 23
    Last Post: 04-10-2009, 04:27 AM

Tags for this Thread