1) Create a Python program that uses a while loop and prompts the user for a series of inputs. You should use a sentinel value to signal when the loop should terminate. Calculate and display the sum...

1 answer below »
N/A


1) Create a Python program that uses a while loop and prompts the user for a series of inputs. You should use a sentinel value to signal when the loop should terminate. Calculate and display the sum of the user inputs. Some examples that you might use are the following: · Total number of miles traveled on a road trip. · Total cost of groceries in a month. · Total number of accidents in a year. You must choose something different from any of the above, however. Include comments in your code program that describe what the program does. Submit your code as an attachment (.py file) and post a screen shot of executing your program on at least one test case. Be sure to choose a program different from any of the programs already posted by your classmates. Week 5 This week's assignment involves writing a Python program to compute the weighted average grade for each student in a group of four students. In addition, it should determine which student has the highest average. Your program should include a list of four student names. You decide on the names of the four students. Each student will have three grades--one for the discussion, one for the quiz and one for the programming assignment.  Weighted averages work by assigning a percentage weight to each grade and then multiplying the grade. (i.e a 40% weight of a grade would be   .40 * grade).  You should decide on the weights for each of the three grades, but the three weights must add to 1 and the three must be different (i.e.  .20   .30   .50). Apply the appropriate weight to each grade and sum to get the weighted average. Your program must include a function that accepts the student name, prompts the user for the three grades and computes and returns the average. In the main program, inside a for loop, that function should be called successively and the name of the student and the student's grade should be displayed. In addition a check should be made to determine whether that student's grade is the highest so far. Once the loop completes, the name of the student with the highest grade, and that grade should be displayed. If more than one student has the highest grade, display the name of the first such student. Your program should include Header comments (what the program does) and in-line comments (the major design steps).   Document the values you chose for the student name list as well. Also document the values you chose as the weights for the three grades in your comments as well. Submit your Python program as a text file ( .py) file.  In addition, submit a Design outline and a Test plan/report (at least 3 different test cases) in a Word document or a .pdf file and include a screen shot of execution of your program for each test case.  By this point in learning how to program you might ask yourself, How do I know if my program is working correctly?  That is not an easy question to answer.  If you run your program and it terminates with a Syntax Error, you obviously have made a mistake somewhere.  But what if it does not terminate?  What happen if it executes and produces output?  How do you know the output is correct? One of the most common ways to gain confidence in your program is to write and execute Test Cases.  A Test Case is a test that you will perform on your program and it will either Pass or Fail the test.  There are many ways to write Test Cases.  Some are more formal than others.  We are going to use a very informal way to write Test Cases.  A Test Case has only two parts: Input and Expected Output.  The Input is a set of input values to the program and Expected Output is the correct output for that set. A set of Test Cases is called a Test Plan or Test Suite.  When you execute your program with the input values in the Test Plan you can generate a Test Report. A Test Report has the Test Cases along with Actual Output and Result.  Actual Output is the output that the program gave for the input.  Result is either Pass or Fail.   Let us look at an example.  I would like to create a program to determine if three lengths can form a Triangle.  So, the sum of any two sides cannot be shorter than the third side.  Here is the program that was created.  It seems to work.   print("The program will determine if 3 sides can form a triangle.") print("Enter side 1") side1 = eval(input()) print("Enter side 2") side2 = eval(input()) print("Enter side 3") side3 = eval(input()) if (side1 + side2 < side3):=""  =""  ="" print("not="" triangle")="" elif="" (side2="" +="" side3="">< side1):     print("not triangle") else:     print("triangle") here is a set of test cases, or test plan/suite, that we can make for this program. now, i will execute all of the test cases and generate a test report. after running the test plan/suite i see that not all of my test cases have passed.  that means that i have a mistake somewhere in my program.  after examining the program i see that i never check for the situation when the sum of sides 1 and 3 are less than side 2. side1):=""  =""  ="" print("not="" triangle")="" else:=""  =""  ="" print("triangle")="" here="" is="" a="" set="" of="" test="" cases,="" or="" test="" plan/suite,="" that="" we="" can="" make="" for="" this="" program.="" now,="" i="" will="" execute="" all="" of="" the="" test="" cases="" and="" generate="" a="" test="" report.="" after="" running="" the="" test="" plan/suite="" i="" see="" that="" not="" all="" of="" my="" test="" cases="" have="" passed. ="" that="" means="" that="" i="" have="" a="" mistake="" somewhere="" in="" my="" program. ="" after="" examining="" the="" program="" i="" see="" that="" i="" never="" check="" for="" the="" situation="" when="" the="" sum="" of="" sides="" 1="" and="" 3="" are="" less="" than="" side="">
Answered 2 days AfterNov 20, 2022

Answer To: 1) Create a Python program that uses a while loop and prompts the user for a series of inputs. You...

Pratyush answered on Nov 21 2022
41 Votes
Test Plan report:
    Test Case
    Input
    Expected Output
    1
    weights = [0.2,0.3,0.5]
student
s=[sachin,sehwag,dhoni,rohiy]
student-1 marks=[20,30.5,40]
student-2 marks=[50,70,90]
student-3 marks=[45,78,23.56]
student-4 marks=[70,70,70]
    
Best Average Student: “Sehwag”
His Grade...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here