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

Math

Sure! Here's a step-by-step program to calculate the semester grade based on the given criteria:

1. Start by defining the `Ceil` function as `Ceil(x) = -int(-x)`. This function will round non-integer numbers up to the nearest integer. You can include this function before the main program code.

2. Now, let's write the main program code:

```
# Define the Ceil function
def Ceil(x):
return -int(-x)

# Get the numeric grades for the midterm and final exam
midterm_grade = float(input("Enter the numeric grade for the midterm exam: "))
final_exam_grade = float(input("Enter the numeric grade for the final exam: "))

# Calculate the semester average
semester_average = (midterm_grade + (final_exam_grade * 2)) / 3

# Round up the semester average to the nearest whole number
rounded_average = Ceil(semester_average)

# Assign the semester grade based on the rounded average
if rounded_average >= 90:
semester_grade = "A"
elif rounded_average >= 80:
semester_grade = "B"
elif rounded_average >= 70:
semester_grade = "C"
elif rounded_average >= 60:
semester_grade = "D"
else:
semester_grade = "F"

# Display the semester grade
print("The semester grade is:", semester_grade)
```

This program first defines the `Ceil` function as requested. Then, it prompts the user to enter the numeric grades for the midterm and final exams.

The semester average is calculated by adding the midterm grade with twice the final exam grade, and then divided by 3. The `Ceil` function is applied to round this average to the nearest whole number.

Finally, based on the rounded average, the corresponding semester grade is assigned using if-elif-else conditions. The resulting semester grade is then displayed to the user.

I hope this helps! Let me know if you have any further questions.

Sure! Here's a program written in Python that fulfills the requirements you mentioned:

```python
def calculate_average(midterm, final):
# multiply the final exam grade by 2
final *= 2

# calculate the semester average
semester_average = (midterm + final) / 3

# round up the semester average to the nearest whole number
semester_average = ceil(semester_average)

# assign the semester grade based on the semester average
if semester_average >= 90:
return 'A'
elif semester_average >= 80:
return 'B'
elif semester_average >= 70:
return 'C'
elif semester_average >= 60:
return 'D'
else:
return 'F'

def ceil(x):
return -int(-x)

# ask the user to enter numeric grades for midterm and final exams
midterm_grade = float(input("Enter the numeric grade for the midterm exam: "))
final_grade = float(input("Enter the numeric grade for the final exam: "))

# calculate the semester grade
semester_grade = calculate_average(midterm_grade, final_grade)

# output the semester grade
print("The semester grade is:", semester_grade)
```

To run this program, you can simply copy and paste it into a Python IDE or editor and then execute it. The program will prompt you to enter the numeric grades for both the midterm and final exams. After you provide the grades, it will calculate the semester average and then assign the appropriate letter grade based on the provided criteria. Finally, it will display the semester grade on the console.

Note: The function `ceil(x)` has been defined to round non-integer numbers up to the nearest integer. We use this function to round up the semester average to the nearest whole number, as specified in the requirements.

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