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
Posted: Sat May 14, 2022 4:46 pm
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()
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()