>>> print(" This program will display a 19% profit based on the sales number entered by the user.")
This program will display a 19% profit based on the sales number entered by the user.
>>> userInputString=input("Enter amount of sale:")
Enter amount of sale:34707
>>> userOriginalSale=float(userInputString)
>>> profit=(19/100)*userOriginalSale
>>> print("Profit Amount:$",profit)
Profit Amount:$ 6594.33
Overall, this process is new for me, since I do not have much programming experience. I have dabbled in some Java and C++ for my Associates Degree but that was years ago. However, from what I have encountered so far, while it still seems a bit confusing, Python does seem a bit easier to understand than
other programming languages. I began with a print line explaining what the program was supposed to do. I stated that the program would show a profit of 19% based on a sales number entered by the user. The input is displayed by the userInputString and shows the line of code where the user would “Enter amount of sale”. The next line of code takes the user’s original sale amount and converts it to a float (integer to a decimal place) and incorporates the unserInputString. The next line of code displays the profit at 19% calculated by 19/100, multiplied by the userOriginalSale. The output is the result of the print command which displays the profit amount in “$” based on the last line of code. This profit is displayed at 19% of the sales amount entered by the user.