Please can I get a test plan for this python code?I need just a test plan in a tabular form..Thanks. #define function de

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Please can I get a test plan for this python code?I need just a test plan in a tabular form..Thanks. #define function de

Post by answerhappygod »

Please can I get a test plan for this python code?I need just a
test plan in a tabular form..Thanks.
#define function
def get_weighted_scores(name):
Assignment_weight = 0.50
Quiz_weight = 0.30
Discussion_weight = 0.20
#prompt user for scores
discussion_score = float(input(f'{name}, enter score
in discussion: '))
quiz_score = float(input(f'{name}, enter score in
quiz: '))
assignment_score = float(input(f'{name}, enter score
in assignment: '))
#computes and returns the average.
average = discussion_score * Discussion_weight +
quiz_score * Quiz_weight + assignment_score *
Assignment_weight
return average
# define function
def main():
names = ['Rabiya', 'Kayed', 'Finley', 'Lionel']
highest_score = 0
top_student_name = ''
for i in range(len(names)):
w_score =
get_weighted_scores(names)
print(f'\n{names} weighted score:
{w_score:.2f}\n\n')
#describes highest score
if i == 0 or highest_score <
w_score:
highest_score =
w_score
top_student_name =
names
#prints name of student with highest score
print(f'Top student is {top_student_name} with score
: {highest_score:.2f}')
main()
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply