Posted by **Shirley** on Tuesday, April 16, 2013 at 10:31pm.

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 -
**Steve**, Wednesday, April 17, 2013 at 11:41am
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";

- programming -
**angel**, Wednesday, April 17, 2013 at 12:10pm
Math

## Answer This Question

## Related Questions

- statistics - In a large class, there were 220 students who wrote both the ...
- Math - Professor Smith gives only a midterm exam and a final exam. The average ...
- C++programming - Write an interactive C program that will accept each student’s ...
- c++ - Write a program that asks the user to input a grade that he or she ...
- visual basic programming - Write a Visual Basic program that will calculate the...
- math - An instructor counts homework as 1/3 of the student's grade and the ...
- Programming C++ using Data Structure. - In an academic institution, Student has ...
- algebra - A student's grade in a course is the average of 4 test grades and a ...
- working with data - josephs final averages in science class are shown in the ...
- English - Hello all. I speak very little of english. My teacher emailed me this ...

More Related Questions