Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solve using Python Programming. In Exercises 15 through 18, identify the

ID: 3749081 • Letter: P

Question

Please solve using Python Programming.

In Exercises 15 through 18, identify the errors, state the type of each error (syntax, runtime, or logic), and correct the block of code.

17.

major = "Computer Science"

In Exercises 19 through 24, simplify the code.

19.

if (a == 2):

23.

FIGURE 3.4 Possible outcome of Exercise 25.

FIGURE 3.6 Possible outcome of Exercise 27.

FIGURE 3.8 Possible outcome of Exercise 29.

31. Compute an AverageWrite a program that requests three scores as input and displays the average of the two highest scores. See Fig. 3.10.

FIGURE 3.10 Possible outcome of Exercise 31.

Explanation / Answer

15)

17)

19)As anyway 'a' takes the value 5 it can be directly assigned the value 5 as

a=5

21)

23)

25)

Code for the program is

#It is self-explanatory

Output:

Enter amount of bill:25.98
Tip is $ 3.9

27)

Output:

Enter number of widgets:200
Cost Is $ 40.0

29)

Output:

Who was the first Ronald McDonald?Willard Scott
You are Correct

31)

Output:

Enter first score:85
Enter second score:93
Enter third score:91
Average of two highest scores is 92.0