programming

Write a program that requests the numeric grades on a midterm and a final exam and then uses a Function procedure to assign a semester grade (A, B, C, D, OR F). The final exam should count twice as much as the midterm exam, the semester average should be rounded up to the nearest whole number, and the semester grade should be assigned by the folowing criteria: 90-100 (A), 80-89 (B), ... Use a function called Ceil that rounds noninteger numbers up to the nearest integer. The function Ceil can be defined by Ceil(x) = -int(-x).

  1. 👍 0
  2. 👎 0
  3. 👁 470
  1. Here's a little perl program that handles the job:

    sub Ceil {
    my $x = shift;
    int($x+.9999);
    }

    print "Numeric grades for midterm and final: ";
    my ($m,$f) = split /[,\s]/,<STDIN>;
    $avg = Ceil(($m+2*$f)/3);
    $grade = qw(F F F F F F D C B A A)[int($avg/10)];
    print "Midterm: $m
    Final: $f
    Average: $avg
    Grade: $grade\n";

    1. 👍 0
    2. 👎 0
  2. Math

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. math

    A​ student's course grade is based on one midterm that counts as 15​% of his final​ grade, one class project that counts as 15​% of his final​ grade, a set of homework assignments that counts as 40​% of his final​

    asked by maria on February 17, 2019
  2. Math

    In a large section of a statistics class, the points for the final exam are normally distributed, with a mean of 72 and a standard deviation of 9. Grades are to be assigned according to the following rule: The top 10% receive A's.

    asked by Alex on November 18, 2016
  3. math

    A student’s final grade in chemistry is determined by the following weights: Quizzes 5% Exam 1 20% Exam 2 20% Lab Reports 15% Research Paper 15% Final Exam 25% The student received the following grades: Lab reports: 75 80 70 75

    asked by Jayden on February 6, 2015
  4. Statistics

    In Professor Smith's statistics course, the correlation between students' total scores before the final exam and their final exam scores is r = 0.67. The pre-exam totals for all students in the course have a mean of 275 and a

    asked by Jannel on February 1, 2009
  5. statistics

    A​ student's course grade is based on one midterm that counts as 5​% of his final​ grade, one class project that counts as 25​% of his final​ grade, a set of homework assignments that counts as 35​% of his final​

    asked by Karen Ventura on June 27, 2019
  1. Math

    In a large section of a statistics class, the points for the final exam are normally distributed, with a mean of 72 and a standard deviation of 9. Grades are to be assigned according to the following rule: The top 10% receive A's.

    asked by Alex on November 18, 2016
  2. elementary statistics

    A statistics professor is used to having a variance in his class grades of no more than 100. He feels that his current group of students is different, and so he examines a random sample of midterm grades (listed below). At 0.05

    asked by David on November 30, 2013
  3. Quantitative methods

    the mean and standard deviation of the grades of 500 students who took an maths exam were 69 and 7 respectively. if the grades have a bell shaped distribution, how many of these students received a grade of more than 83 marks?

    asked by lisa on April 7, 2011
  4. math

    In a course a student's final exam is weighted as heavily as his mid term exam.if a student receives a score of 84 on his final exam 90 on his midterm,what is the average for the course?

    asked by tish on June 10, 2016
  5. Algebra

    Before the final exam, a student has test scores of 72, 80, 65, 78, and 60. If the final exam counts as one-third of the final grade, what score must the student receive in order to have a final average of 76 percent? Thanks!!

    asked by Serena on September 14, 2013
  6. Stats

    A class of 85 students writing an exam had a mean mark of 74.2 write down the total sum of the 85 grades.

    asked by Rachael on September 26, 2012

You can view more similar questions or ask a new question.