Question
Today you are taking 3 parallel, yes 3 parallel arrays, search through them and produce a file report. I have given you an array called
Today you are taking 3 parallel, yes 3 parallel arrays, search through them and produce a file report.
I have given you an array called itemArray that has 5 items; Baseballs, Bats, Gloves, Hats and Jerseys.There is also an array called itemCost that has 5 amounts that match the price for each item in order.For example, item 3, Gloves has a price of $75.10.
There is also a third array, quantitySold that holds the number of each item sold.For example, item 2, Bats, cost $35.50 had 10 sold today.For step 1, use the quantitySold array I give you.For step 2, make a module to enter quantity sold for each item.
Raptor commands that you should use:
Set_Percision(2) will set numbers to two decimal points (like money).Unfortunately, it will add 2 decimal points to all numbers, like quantity.Use this once at the beginning of your flowchart in an Assignment.
Lenth_of(arrayname) will return the value of the total number of items in an array.Use this in your loops, to know when at the end of the array.
Redirect_Output("filename.txt") will send all output to a file.Use this before you use Output symbols.Remember to do outside of loops or you will recreate the file. solve this in a Call symbol.
Step 1:
Use my setupItemArray, setupQuantityArray and setupItemCostArray to load the 3 arrays.
Open a file using the Redirect_Output command in a Call symbol.
make
a title and header for your file report as shown below.
Loop through the arrays and put the item number, item, quantity and cost for all items in the report.
Try to make your spacing like mine, it does not need to be perfect, but close.Also, add a dollar sign for the cost.
Keep a running total of the amount sold for the day, quantity multiplied by cost for each item, added to the daily total.
At the end of the report, display the total sold amount for the day. Make sure this number has a dollar sign as well.
Your file should look like this:
Items Sold Today Report
NumItemQuantityCost
1.00Baseballs15.00$6.75
2.00Bats14.00$35.50
3.00Gloves10.00$75.10
4.00Hats20.00$19.99
5.00Jerseys17.00$49.13
Total Sales for the day:$2584.26
Step 2:
Create a new module called, enterQuantitySold.Loop through the itemArray until the end and prompt the user to enter the quantity sold for each item and put in the quantitySold array, use the name of the item in your prompt.
Now your results will differ each time, because your quantities are different than the quantitySold array I gave you in step 1.
Add a new column in the report after Cost called Total.At each item display the total sale of each item.For example, number of bats sold times cost of each bat.
Also, after your put the daily total line in the file, check to see if the total amount for the day has broken the store record of $5,000.If it did break the record put "A new store record!" in the report, otherwise put "Store record of $5,000 not broken" in the report.
Your Step 2 file should look something like one of these, depends on the quantities you enter:
Items Sold Today Report
NumItemQuantityCostTotal
1.00Baseballs33.00$6.75$222.75
2.00Bats19.00$35.50$674.50
3.00Gloves22.00$75.10$1652.20
4.00Hats89.00$19.99$1779.11
5.00Jerseys30.00$49.13$1473.90
Total Sales for the day:$5802.46
A new store record!
OR if not over $5,000 in sales for the day, it should look something like this:
Items Sold Today Report
NumItemQuantityCostTotal
1.00Baseballs25.00$6.75$168.75
2.00Bats10.00$35.50$355.00
3.00Gloves11.00$75.10$826.10
4.00Hats32.00$19.99$639.68
5.00Jerseys13.00$49.13$638.69
Total Sales for the day:$2628.22
Store record of $5000.00 not broken
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Beyond a shadow of a doubt we ought to isolate the endeavor little by little and make an unequivocal explanation of how to manage equivalent shows and ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started