• Using Php Script write a program that will compute the students average
• The user will input the following:
Name
Math
Science
English
• If the average is equal and above 75, it will display “Congratulations. You passed the semester” otherwise “You failed the semester.”
name = input('Enter name: ')
math = int(input('Enter math: '))
science = int(input('Enter science: '))
english = int(input('Enter english: '))
average = (math + science + english) / 3
if average < 75:
print(f'\nYour average: {average}'f'\nYou failed the semester, {name}')
else:
print(f'\nYour average: {average}'f'\nCongratulations, {name} You passed the semester')
Comments
Leave a comment