Question: Program To be build in Programming Language C , also There are Instructions and Outputs Given in the pictures and to use them properly. Part-2

 Program To be build in Programming Language C , also There

are Instructions and Outputs Given in the pictures and to use them

properly. Part-2 (40%) Instructions In a new source code file "w4p2.c", upgrade

the solution to Part-1 to include an analysis of the entered data

and provide the forecasted number of years and months it will take

Program To be build in Programming Language C , also There are Instructions and Outputs Given in the pictures and to use them properly.

Part-2 (40%) Instructions In a new source code file "w4p2.c", upgrade the solution to Part-1 to include an analysis of the entered data and provide the forecasted number of years and months it will take to save enough to purchase the wish list items. . . . . 1. Review the "Part-2 Output Example (next section) to see how the program is expected to work 2. Display a menu with three (3) options: 1. All Items (no filter) 2. By priority 0. Quit/Exit Note: Prompt for a menu selection; where valid values are from 0 to 2 The menu should be in an iteration construct and only exit / end the program when 0 is entered by the user 3. If O is entered, the program should display the exit message and end DO NOT use spaghetti code tactics by forcing the iteration to jump out of the iteration using statements like break, exit(), or goto Use a control variable (flag) to control the flow 4. If an invalid value is entered (that is not a 1, 2, or 0), then display an appropriate error message and continue to iterate and prompt for a valid menu selection 5. When option 1 is entered, iterate all wish list items and: Accumulate (total) each item cost Check if the item has financing options (value will be Y') and make note if it (this will be used later to show an additional "note" in the summary output) 6. When option 2 is entered: This will follow the same directions as described in #5 only you will not accumulate (total) all the items, but will only consider items that match on the user entered priority value Therefore, before iterating, you must prompt the user to specify a priority level to filter by (valid values are 1 to 3) Display an appropriate error message if the entered value is out of range Validation must be nested in an iteration construct repeating until a valid value is entered Just as described in #5, accumulate the item cost and check for financing options (only for the items that match on the specified priority level) 7. After menu options 1 or 2, display a forecast summary: The summary should be wrapped (first and last line) with a double line. Use the following: printf(" ======= "); . . . o O . ===== == -pdf + 2 1 Page view | A Read aloud | Draw . Display the appropriate filter used to generate the results (based on option 1 or option 2): printf("Filter: All items "); // [option-1] printf("Filter: by priority (%d) "... // [option-2] Display the total cost of the items (derived from the filtering option selected) printf("Amount: $%1.21f ", Display the forecasted number of years and months it will take to save enough to purchase the items. Hint: The modulus operator will help you greatly with this! Display an extra "Note" only if any of the items had financial options to indicate that a shorter time is likely possible . Part-2 Output Example (Note: Use this data for submission) + Wish List Forecaster Enter your monthly NET income: $0 ERROR: You must have a consistent monthly income of at least $500.00 Enter your monthly NET income: $500000 ERROR: Liar! I'll believe you if you enter a value no more than $400000.00 Enter your monthly NET income: $6225.88 How many wish list items do you want to forecast?: ERROR: List is restricted to between 1 and 10 items. How many wish list items do you want to forecast?: 11 ERROR: List is restricted to between 1 and 10 items. How many wish list items do you want to forecast?: 5 Item-1 Details: Item cost: $39030.15 How important is it to you? [1=must have, 2=important, 3=want] : 0 ERROR: Value must be between 1 and 3 How important is it to you? [1=must have, 2=important, 3=want]: 4 ERROR: Value must be between 1 and 3 How important is it to you? [1=must have, 2=important, 3=want]: 1 Does this item have financing options? [y]: N ERROR: Must be a lowercase 'y' or 'n' Does this item have financing options? [y]: Y ERROR: Must be a lowercase 'y' or 'n' Does this item have financing options? [y]: K ERROR: Must be a lowercase 'y' or 'n' Does this item have financing options? [y]: n Item-2 Details: Item cost: $99.99 ERROR: Cost must be at least $100.00 Item cost: $1200000 How important is it to you? [1=must have, 2-important, 3-want]: 3 Does this item have financing options? [y]: y Item-3 Details: Item cost: $350500.25 How important is it to you? [1=must have, 2-important, 3=want]: 2 Does this item have financing options? [y]: n Item-4 Details: Item cost: $15500.75 How important is it to you? [1=must have, 2-important, 3-want): 1 Does this item have financing options? [y]: y Item-5 Details: Item cost: $6575.55 How important is it to you? [1=must have, 2-important, 3=want]: 3 Does this item have financing options? [y]: n Item Priority Financed Cost n 1 2 3 4 5 1 3 2 1 3 n 39030.15 1200000.00 350500.25 15500.75 6575.55 n $ 1611606.70 How do you want to forecast your wish list? 1. All items (no filter) 2. By priority O. Quit/Exit Selection: 3 ERROR: Invalid menu selection. How do you want to forecast your wish list? 1. All items (no filter) 2. By priority O. Quit/Exit Selection: 1 EEEEEEEEEEEE EEEEEEEEE Filter: All items Amount: $1611606.70 Forecast: 21 years, 7 months NOTE: Financing options are available on some items. You can likely reduce the estimated months. EDIBLE How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 0. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 1 EEEEEEEEE Filter: by priority (1) Amount: $54530.90 Forecast: 0 years, 9 months NOTE: Financing options are available on some items. You can likely reduce the estimated mont EEEEEE ======== How do you want to forecast your wish list? 1. All items (no filter) 2. By priority e. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 2 ======= Filter: by priority (2) Amount: $350500.25 Forecast: 4 years, 9 months SES How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 0. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 3 EEEEEEEEE Filter: Amount: by priority (3) $1206575.55 Forecast: 16 years, 2 months NOTE: Financing options are available on some items. You can likely reduce the estimated months. FEBRE EEEEEMBEDDERE How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 0. Quit/Exit Selection: Best of luck in all your future endeavours! Reflection (50%) Instructions Create a text file named "reflect.txt" Record your answer in the reflect.txt file for each of the following: . 1. Parallel arrays provide us the ability to group related data. Using what you coded in this workshop, briefly explain how you linked related data for any given item in the dataset? What was the 'key' used to accomplish this? 2. Why do you think it is common practice to iterate arrays initializing the iterator variable to zero and not to a value of one? Justify your answer using an example from this workshop. 3. How would you describe conceptually what an array is to a child (5-8-year-old)? How would you describe accessing an element in the array? Warning: keep your explanation simple or the child will not understand

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!