Skip to content

Commit 2af97fb

Browse files
authored
Displays the Annual Profit for A company (Chapter 2)
1 parent e658404 commit 2af97fb

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

2.2. Sales Prediction .py

-4
This file was deleted.

2.2. Sales Prediction.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
2. Sales Prediction
3+
A company has determined that its annual profit is typically 23 percent
4+
of total sales. Write a program that asks the user to enter the projected
5+
amount of total sales, and then displays the profit that will be made from that amount.
6+
Hint: Use the value 0.23 to represent 23 percent.
7+
Reference:
8+
(1) Starting out with Python, Third Edition, Tony Gaddis
9+
(2) https://youtu.be/qTKJuVTgv2Q """
10+
11+
# (1) Get User Input as string (projected amount of total sales)
12+
# (2) convert uset input to float
13+
projectedSales = float(input("Please Enter the projected amount of total sales : "))
14+
15+
# Calculate the annual profit
16+
annualProfit = projectedSales * 0.23
17+
18+
# printing the final Result in Formated
19+
print("the annual profit is : $" + format(annualProfit, ",.2f"))
20+
21+
22+
23+

0 commit comments

Comments
 (0)