Price Calculation and Analysis Using Python Exercises
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →CST201 Program Assignment 1 This assignment consists of 2 small programs each worth 35 points for a total of 70 points. PROGRAM 1 Write a program to prompt a user for an item, the price of an item (such as 25.50) and weight of an item in pounds and ounces. Make sure you correctly declare and initialize to their null value all variables (use naming convention of variables as we learned in class). Each variable needs to be set to null based on the type of variable. The user will not enter the text of “pounds” or the “ounces” but, just numeric values. Meaning if the item weighs 6 pounds 2 ounces the user will enter 6 in one prompt for pounds and 2 in another prompt for ounces. When prompting the user make sure it is clear to the user how they are to enter the input (you can use a print message statement prior to the prompt to clarify input) and use exception handling to help ensure correct data input. Also, make sure your prompt is clear of spelling and grammar errors. The program is to restate the input as output. There should be output for the item in price per ounce (hint there are 16 ounces to a pound (this is a constant variable)). All monetary output should include a dollar sign and show the output in 2 decimal places with a comma. Output should be clear of spelling and grammar errors and be separated from the input prompts by several blank lines. The program should have appropriate comments based on what we learned within in-class work. PROGRAM 2 Write a program to request the purchase price of an item and the selling price of an item. The program is to give output of price increase of the item, percent increase of the item and profit margin of the item. This is figured by: • • • PRICE INCREASE = ITEM SELLING PRICE – ITEM PURCHASE PRICE PERCENT INCREASE = PRICE INCREASE ÷ ITEM PURCHASE PRICE PROFIT MARGIN = PRICE INCREASE ÷ ITEM SELLING PRICE Make sure you correctly declare and initialize to their null value all variables (use naming convention of variables as we learned in class). Each variable needs to be set to null based on the type of variable. When prompting the user make sure it is clear to the user how they are to enter the input (you can use a print message statement prior to the prompt to clarify input) and use exception handling to ensure correct data input. Also, make sure your prompt is clear of spelling and grammar errors. The program is to restate the input as output. The output should include price increase, percent increase, and profit margin (this is a percent too). All monetary output should include a dollar sign and show the output in 2 decimal places with a comma. All percent output should be taken to 1 decimal place and show the percent symbol. Output should be clear of spelling and grammar errors and be separated from the input prompts by several blank lines. The program should have appropriate comments based on what we learned within in-class work. When you code these programs make sure you use proper variable naming and add comments to the program per what we learned within the in-class examples. Please make sure you are completing your own work. There is no possible way 2 people can create the exact same program code. Remember if you share your files both the student who submitted another student’s file and the person who gave the file to that student will get a zero (0) on the assignment. If you use AI to generate code, make sure you understand the code because for the exams it will be imperative you understand the code. Make sure the AI is completing the work per the directions.
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds