Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a program that will calculate price differentials for products for the FAMUly Store. The program will read information for 10 products stored in a

image text in transcribed
image text in transcribed
Develop a program that will calculate price differentials for products for the FAMUly Store. The program will read information for 10 products stored in a file. The file has the following format: Product-Name Past-Year Past-Year-Price Current-Year Current-Year Price An example entry in the file would be Chips 2000 3.44 2010 4.74 Your program will read the file and calculate the percentage price change between the past year price and the current year price. For example, the entry above will produce the following output Price Comparison 2000 to 2010 Item: Chips Past Year Price: $3.44 Current Year Price: $4,74 Percent change: 37.8% For any percentage change that is greater than 50% and the year span is less than 4 years, the program should display a message after the report that says "Please Monitor Here is another example entry Asparagus 2001 2.50 2003 4.50 Here is the output that will be produced Price Comparison: 2001 to 2003 Item: Asparagus Past Year Price: $2.50 Current Year Price $4.50 Percent change: 80% Please Monitor The percentage price change is: (Current Year Price - Past Year Price) Past Year Price ) X 100 Use the file products.txt to test your program. The file has 10 entries in it. Your program should work with any set of 10 entries, so modify the data in the file to make sure your program work properly on different data. When your program is executed on the file, it will produce 10reports like the following, plus at the end it shows the average price of items for current prices after the year 2014 Price Comparison: - Item: Past Year Price Current Year Price: Percent change *** Please Monitor Price Comparison: Item: * Past Year Price Current Year Price: Percent change: Price Comparison Item Past Year Price Current Year Price Percent changes Please Monitor Price Comparison liem Pasl Year Price Current Year Price Percent change Please Monitor Price Companies Item*** Past Year Price Current Year Price Percent change Average prices for current prices after 2014 CH CONCEPTS TO USE FOR THEIS ASSIGNMENT: For Loop If statement Float Double/String data type

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions