Question: Assignment Do problem 1 through 5 and submit for each problem a .py file a screenshot of the result Please comment your code and make

Assignment

Do problem 1 through 5 and submit for each problem

  1. a .py file
  2. a screenshot of the result

Please comment your code and make sure you place the following header on every assignment:

First and Last name

Date (submission date)

Exercise 1: To make sure that you can interact with IDLE, try the following steps on your computer:

  1. Start IDLE. To do this in Windows, click the Start button, then All Programs. In the Python program group click IDLE (Python GUI).
  2. At the >>> prompt type the following statement and then press Enter:

print('This is a test of IDLE.')

  1. After pressing the Enter key the Python interpreter will execute the statement. If you typed everything correctly, your session should look like this:

>>> print('This is a test of IDLE.')

This is a test of IDLE.

>>>

If you see an error message, enter the statement again and make sure you type it exactly as shown.

  1. Exit IDLE by clicking File, then Exit (or pressing Ctrl-Q on the keyboard).

Exercise 2: Personal Information

Write a program that displays the following information:

  1. Your name
  2. Your address, with city, state, and ZIP
  3. Your telephone number
  4. Your college major

Exercise 3: Sales Prediction

A company has determined that its annual profit is typically 23 percent of total sales. Write a program that asks the user to enter the projected amount of total sales, and then displays the profit that will be made from that amount.

Hint: use the value 0.23 to represent 23 percent.

Exercise 4: Total Purchase

A customer in a store is purchasing five items. Write a program that asks for the price of

each item, and then displays the subtotal of the sale, the amount of sales tax, and the total.

Assume the sales tax is 6 percent.

Exercise 5: Distance Traveled

Assuming there are no accidents or delays, the distance that a car travels down the interstate

can be calculated with the following formula:

Distance = Speed *Time

A car is traveling at 60 miles per hour. Write a program that displays the following:

The distance the car will travel in 5 hours

The distance the car will travel in 8 hours

The distance the car will travel in 12 hours

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!