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: 90100 (A), 8089 (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 ...
 C++programming  Write an interactive C program that will accept each studentâ€™s ...
 Math  Professor Smith gives only a midterm exam and a final exam. The average ...
 c++  Write a program that asks the user to input a grade that he or she ...
 College Algebra  Matt scored 75 on the calculus midterm. If the final exam ...
 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 ...
 English  Hello all. I speak very little of english. My teacher emailed me this ...
 VNS,Math  Mr. Bobby bought 50 shares at $60, and 2 months later purchased 25 ...
 math  A studentâ€™s final grade in chemistry is determined by the following ...
More Related Questions