Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

fPart-2 (40%) Instructions Code your solution to Part-2 in the provided w6p2.c source code file. Upgrade the solution to Part-1 to include an analysis of

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
\fPart-2 (40%) Instructions Code your solution to Part-2 in the provided "w6p2.c\" source code file. 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. 2. Review the "Part-2 Output Example\" (next section) to see how the program is expected to work 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 O to 2 o The menu should be in an iteration construct and only exit / end the program when 0 is entered by the user If 0 is entered, the program should display the exit message and end 0 DO NOT use spaghetti code tactics by forcing the iteration to jump out of the iteration using statements like break, exit\7. After menu options 1 or 2, display a forecast summary: 0 The summary should be wrapped (first and last line) with a double line. Use the following: pr'int'F( "====================================================\ "|'l ); - 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\ ", 0 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! a Display an extra "Note\" only if any of the items had financial options to indicate that a shorter time is likely possible Pa rt2 Outgut Example (Note: Use the YELLOW highlighted user-input 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?: 0 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]: 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]: 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]: Does this item have financing options? [y]: y Item-S Details: Item cost: $6575.55 How important is it to you? [1=must have, 2=important, 3=want]: Does this item have financing options? [y]: n Item Priority Financed Cost 1 1 n 39030.15 2 3 y 1200000.00 3 2 n 350500.25 4 1 y 15500.75 5 3 n 6575.55 $ 1611606.?0 How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 0. 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 0. Quit/Exit Selection: 1 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. How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 6. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 1 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 months. How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 9. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 2 Filter: by priority (2) Amount: $350506.25 Forecast: 4 years, 9 months How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 9. Quit/Exit Selection: 2 What priority do you want to filter by? [1-3]: 3 Filter: by priority (3) Amount: $1296575.55 Forecast: 16 years, 2 months NOTE: Financing options are available on some items. You can likely reduce the estimated months. How do you want to forecast your wish list? 1. All items (no filter) 2. By priority 9. Quit/Exit Selection: 0 Best of luck in all your future endeavours! Reflection (50%| Instructions 1. Record your answer(s) to the reflection question(s) in the provided "reflecttxt" text file 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 thb? 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. 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. Academic Integrity It is a violation of academic policy to copy content from the course notes or any other published source (including websites, work from another student, or sharing your work with others). Failure to adhere to this policy will result in the filing of a violation report to the Academic Integrity Committee. Part-2 Submission PP'P!' 6. Upload your source file "w6p2 . c\" to your matrix account Upload your reflection file \"re-Flect . txt\" to your matrix account (to the same directory) Login to matrix in an SSH terminal and change directory to where you placed your workshop source code. Manually compile and run your program to make sure everything works properly: gcc -Wa11 w6p2. c -0 his (ENTER) If there are no errors/warnings generated, execute it: w6 Run the submission command below (replace profname.proflastname with your professors Seneca userid and replace NAA with your section): ~pr'o-FName . pro-Flastname/ submit 144w6/NAA_p2 Follow the on-screen submission instructions

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions