- Joined
- Mar 30, 2021
- Posts
- 10,031
- Solutions
- 151
- Reaction
- 12,105
- Points
- 3,919
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
python poAnong Language yan? C ?
Ah c language at java lang alam ko, pero heads up lang pre May bayad yan , walang gumagawa ng libreng system tapos ganyan kadami ng conditionspython po
nagawa ko na poAh c language at java lang alam ko, pero heads up lang pre May bayad yan , walang gumagawa ng libreng system tapos ganyan kadami ng conditions
ito lods o tinanong ko kay ChatGPT batay sa image na inupload mo sa ofc website nila sana makatulong
# Get input from user
midterm_score = float(input("Enter your score for Midterm exam (out of 100): "))
finals_score = float(input("Enter your score for Finals exam (out of 100): "))
quiz_total = int(input("Enter the total number of quizzes: "))
activity_total = int(input("Enter the total number of activities: "))
quiz_scores = []
activity_scores = []
for i in range(quiz_total):
quiz_scores.append(float(input("Enter your score for Quiz #" + str(i+1) + " (out of 100): ")))
for i in range(activity_total):
activity_scores.append(float(input("Enter your score for Activity #" + str(i+1) + " (out of 100): ")))
final_project_score = float(input("Enter your score for Final Project (out of 100): "))
# Compute the grades
quiz_percent = sum(quiz_scores) / (quiz_total * 100) * 15
activity_percent = sum(activity_scores) / (activity_total * 100) * 15
midterm_percent = midterm_score / 100 * 25
finals_percent = finals_score / 100 * 25
final_project_percent = final_project_score / 100 * 20
total_percent = quiz_percent + activity_percent + midterm_percent + finals_percent + final_project_percent
# Determine the grade and transmute if necessary
if total_percent >= 75:
grade = "PASSED"
elif total_percent >= 60:
grade = "PASSED with a grade of 3.0"
elif total_percent >= 50:
grade = "PASSED with a grade of 2.5"
elif total_percent >= 40:
grade = "PASSED with a grade of 2.0"
else:
grade = "FAILED"
# Output the result
print("Your total percentage is {:.2f}".format(total_percent))
print("You", grade)
# get user inputs for grades
midterm_score = float(input("Enter your midterm exam score: "))
finals_score = float(input("Enter your finals exam score: "))
quiz_scores = []
for i in range(6):
score = float(input(f"Enter your quiz {i+1} score: "))
quiz_scores.append(score)
activity_scores = []
for i in range(5):
score = float(input(f"Enter your activity {i+1} score: "))
activity_scores.append(score)
final_project_score = float(input("Enter your final project score: "))
# calculate weighted scores
quiz_weighted_score = sum(quiz_scores) / len(quiz_scores) * 0.15
activity_weighted_score = sum(activity_scores) / len(activity_scores) * 0.15
midterm_weighted_score = midterm_score * 0.25
finals_weighted_score = finals_score * 0.25
final_project_weighted_score = final_project_score * 0.2
# calculate total weighted score
total_weighted_score = quiz_weighted_score + activity_weighted_score + midterm_weighted_score + finals_weighted_score + final_project_weighted_score
# transmute score
if total_weighted_score >= 97:
transmuted_score = 1.0
elif total_weighted_score >= 94:
transmuted_score = 1.25
elif total_weighted_score >= 91:
transmuted_score = 1.5
elif total_weighted_score >= 88:
transmuted_score = 1.75
elif total_weighted_score >= 85:
transmuted_score = 2.0
elif total_weighted_score >= 82:
transmuted_score = 2.25
elif total_weighted_score >= 79:
transmuted_score = 2.5
elif total_weighted_score >= 76:
transmuted_score = 2.75
elif total_weighted_score >= 75:
transmuted_score = 3.0
elif total_weighted_score >= 73:
transmuted_score = 3.25
elif total_weighted_score >= 70:
transmuted_score = 3.5
elif total_weighted_score >= 67:
transmuted_score = 3.75
else:
transmuted_score = 5.0
# print final grade and pass/fail status
final_grade = round(total_weighted_score, 2)
print(f"Your final grade is {final_grade} and your transmuted grade is {transmuted_score}.")
if transmuted_score <= 3.0:
print("Sorry, you failed the subject.")
else:
print("Congratulations, you passed the subject!")