I have a project due for school and I'm having a tough time with the logic. I think I need a loop for the days and a loop for the rest of the stuff. Any help would be a godsend.
which the price of any unsold item drops 10 percent each day. Th e inventory fi le includes an item number, description, and original price on day one. For example, an item that costs $10.00 on the f i rst day costs 10 percent less, or $9.00, on the second day. On the third day, the same item is 10 percent less than $9.00, or $8.10. Design an application that reads inventory records and produces a report that shows the price of every item on each day, one through seven
Thanks for the resonse! I think a while loop is the way to go Im just not sure how to carry the discount from one day to the next. This mess is what I have so far.
num discount = * .90
output "Enter Day"
output "enter item number and price"
input itemnumber, price
while DAY = monday
while discount + price = monday
while DAY = tuesday
while discount + monday = tuesday
while DAY = wendsday
while discount + tuesday = wendsday
while DAY = thursday
while discount +thursday = friday
while DAY = friday
while discount + friday = saterday
while DAY = saterday
while discount + saterday = sunday
I would think I could do a while Indefinite loop for the day and another inner while definite loop for the discount and other declarations but I have no idea how to carry the discount from one day to the next. So I ended up with some crazy idea's.
num day = *.10
string = record_itemNumber
file inventory file
while there are still records in the inventory file
input one record in inventory_File
cost =record, original_Price
string = record, original_Price
string = description
for(day2 = 1 to 7)
output record_itemNumber, description, cost
cost = cost *.9