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.
The directions for Assignment Program 1 is under Week 2 and this is the submission link for the completed program. The program is due by the end of Sunday of Week 4.
Requirements: | .doc file
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.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.