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 3rd statement.


x = 345 // 10
b = 6782 % 10
e = x - b * 2
a = "program"+"now"
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 paint and paint brushes to paint the house. Write the program that reads the number of gallons of paint and price per gallon, the number of brushes and price of one brush, and the tax (integer). The program finds and prints the total purchase price. For example, if the person purchased 5 gallons fo paint, 4.99 per gallon, and 4 brushes, 1.99 each, and the tax is 7%, the total purchase price is: 35.21 dollars.

Submission Instructions: