What's new

Python Patulong po sa quiz namin

3-Style

Forum Expert
Elite
Joined
Mar 30, 2021
Posts
10,031
Solutions
151
Reaction
12,105
Points
3,919
Screenshot_2023-03-03-13-55-01-78_40deb401b9ffe8e1df2f1cc5ba480b12.jpg


Screenshot_2023-03-03-13-55-33-25_40deb401b9ffe8e1df2f1cc5ba480b12.jpg
 

Attachments

help me PhC Robot

help me bot
ito lods o tinanong ko kay ChatGPT batay sa image na inupload mo sa ofc website nila sana makatulong

Here's a simple Python program that determines whether you pass a subject or not based on the conditions you provided:
Code:
# 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)
The program first asks the user to input their scores for the midterm exam, finals exam, quizzes, activities, and final project. It then computes the percentage of each requirement based on the inputted values and the weights assigned to each requirement. After that, it computes the total percentage by summing up the percentages of all the requirements.

Finally, the program determines the grade based on the total percentage and outputs the result. If the total percentage is 75 or higher, the student passes the subject. If it's between 60 and 75, the student passes with a grade of 3.0. If it's between 50 and 60, the student passes with a grade of 2.5. If it's between 40 and 50, the student passes with a grade of 2.0. If it's below 40, the student fails.
 
Step 1:
Use OCR app to convert image to text..

Step 2:
Clean up and fix the converted text. (if there are errors/typos)

Step 3:
Send the text to Chatgpt.

Step 4:
Get the solution from chatgpt,
send more question if the answer is wrong, incomplete, incorrect format, or you want more specific answers.

Here's a Python program that calculates your final grade based on the criteria you provided and determines whether you pass or fail the subject:

Python:
# 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!")

Note: This program assumes that the user inputs the scores in the correct order (i.e. quiz scores first, then activity scores, then midterm score, then finals score, then final project score). If the user inputs the scores in a different order, the program will produce incorrect results.
 
Last edited:

Similar threads

Back
Top