Python Programming Question. Please, solutions. Thanks. 1. College Scholarship P
ID: 3716766 • Letter: P
Question
Python Programming Question. Please, solutions. Thanks.
1. College Scholarship Program. The University of California has an academic scholarship program that provides financial rewards to students based on academic merits. The recipient must intend to major in Science, Technology Engineering, and Math (STEM) with at least 3.0 Grade Point Average (GPA) in all subject areas and has completed at least five Advanced Placement (AP) courses in High School.
Students can be awarded different amounts based on the following criteria:
a) $5000 if the average GPA for four science courses is 3.8 or higher
b) $4000 if the average GPA for three science courses is 3.5 or higher
c) $3000 if the average GPA for two science courses is 3.25 or higher
The Python program should prompt for the following questions in determining the eligibility and scholarship award amount:
-Student name
-Intended major
-How many AP courses completed so far
-Of those courses completed, how many are STEM courses.
-GPA for each science related course
-Overall GPA
-Your program should first determine if a student is eligible to get the scholarship based on the major and overall GPA.
-If a student qualifies, the program should then determine the award amount based on the number of science courses completed and the average GPA for those relevant courses.
-If a student qualifies but does not meet any of the three-award amount categories, display appropriate message.
Create a scholarship file that tracks how many students have applied for the scholarship program based on number of times you run the program. Each time you run or test your program, a record should be saved to the scholarship file.
Explanation / Answer
Hi,
here is the full code with comments
#prompting user for required info
name = input('please enter your name: ')
major = input('please enter your intended major: ')
courses = int(input('AP courses completed so far? '))
stemCourses = int(input('Of those courses completed, how many are STEM courses? '))
stemGpa = []
print('GPA for each science related course on new line ')
for i in range(stemCourses):
stemGpa.append(float(input('')))
overallGpa = float(input('Overall GPA? '))
eligibleCourses = ["Science", "Technology Engineering", "Math"]# making list of eligible courses
if ((major in eligibleCourses) and(courses >= 5) and overallGpa >= 3.0): #checking
for all eligibility conditions
print('qualified')
average = sum(stemCourses) / len(stemCourses)# getting avg gpa of science courses# checking the amount eligible
if (len(stemCourses) == 4 and average >= 3.8):
amount = 5000
elif(len(stemCourses) == 3 and average >= 3.5):
amount = 4000
elif(len(stemCourses) == 2 and average >= 3.25):
amount = 3000
else :
print('qualified but not elgible')
file = open("scholarshipFile.txt", "w")
file.write("student with name: " + name + " is eligible for scholarship ")# writing to file
else :
print('not eligible')
Thumbs up if this was helpful, otherwise let me know in comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.