Test 1 CSCI 151

Question 1 (25 points):

For the program below, write calculations performed on each line and write the final output. Explain the order of arithmetic operations in 4th statement.


x = "Python" + "Program"
a = 1578 % 10
b = 123 % 10
e = a - b % 2
print(x)
print(e)

Question 2 (75 points):

Instructions: login to your account. Stay in your HOME directory. Write the program in file called test1.py

The person is purchasing apples and apple pies in the store. Write the program that reads the number of pounds and price per pound for apples, the number of pies and price of one pie, and the tax (integer). The program finds and prints the total purchase price. For example, if the person purchased 3 pounds of apples, 1.99 per pound, and 2 apple pies, 7.99 each, and the tax is 6%, the total purchase price is: 23.27 dollars.

Submission Instructions: