posted by .

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).

  • programming -

    Here's a little perl program that handles the job:

    sub Ceil {
    my $x = shift;

    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";

  • programming -


Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. math

    An instructor counts homework as 1/3 of the student's grade and the final exam to be 2/3 of the student's final grade. Going into the final exam a student has a homework grade of 48%. What range of scores on the final exam would put …
  2. College Algebra

    Matt scored 75 on the calculus midterm. If the final exam counts twice as much as the midterm exam, then for wht range of scores on the final would Matt get an average between 81 and 92?
  3. c++

    Write a program that asks the user to input a grade that he or she received on an exam. The grade is an integer from 0 to 100 inclusive. The program should convert the numeric grade into the equivalent letter grade. Do the conversion …
  4. statistics

    In a large class, there were 220 students who wrote both the midterm and the final exam. The standard deviation of the midterm grades was 14, and that of the final exam was 20. The correlation between the grades on the midterm and …
  5. English

    Hello all. I speak very little of english. My teacher emailed me this and I wan't to make sure I understand correctly. [The final exam will only cover material since the midterm.] this means that final exam will ONLY cover what we …
  6. Math

    Professor Smith gives only a midterm exam and a final exam. The average is computed by taking 1/3 of the midterm exam score and 2/3 of the final exam score. To get a “C” or better students must have at least 70 semester average. …
  7. VNS,Math

    Mr. Bobby bought 50 shares at $60, and 2 months later purchased 25 shares a $ what price should he purchase 25 additional shares in order to have an average price $58 per share?
  8. visual basic programming

    Write a Visual Basic program that will calculate the assessment marks of a student taking the Computer Programming subject in College. The program must be able to determine the total result and finally display the grade of that student. …
  9. 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 85 …
  10. C++programming

    Write an interactive C program that will accept each student’s name an exam grades as input, determine an average grade for each student, and then display the student’s name, the individual exam grades and the calculated average. …

More Similar Questions