Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please write a code for this exact output in C using parallel arrays ( as can be seen in the instructions outlined) O

Can someone please write a code for this exact output in C using parallel arrays ( as can be seen in the instructions outlined)

image text in transcribed

image text in transcribedimage text in transcribed

O . . . . . 1. Carefully review the "Part-1 Output Example" (next section) to see how this program is expected to work 2. Code your program in the file named "w4p1.c" 3. Begin by prompting the user for their NET monthly income The monthly income must be at least $500.00, and not more than $400,000.00 The minimum and maximum values should be stored in unmodifiable variables and used in the validation logic accordingly Display an appropriate error message if the entered value is outside this range Validation must be nested in an iteration construct and repeat until a valid value is entered 4. Next, prompt the user to specify the number of wish list items they want to use in the forecast Note The maximum number of items should be limited to 10 (define a macro to help with this) Display an appropriate error message if the entered value is outside this range Validation must be nested in an iteration construct and repeat until a valid value is entered 5. Now you are ready to store the wish list item details. Use an iteration construct to Iterate the number of times necessary to obtain the number of wish list item details specified by the user (from step #5) 6. The item details are made-up of three (3) related pieces of information and must be stored in matching (parallel) arrays: a) Cost A double floating-point value representing the value of the item The entered value must be at least $100.00 (use an unmodifiable variable to help with the validation logic accordingly) Display an appropriate error message if the entered value is invalid Validation must be nested in an iteration construct repeating until a valid value is entered b) Priority An integer value representing the priority of the item The entered value must be between 1 and 3 inclusive where: 1 = a must-have item 2 = important to have item 3 = want to have item 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 O O O c) Finance Options A character value representing if an item has financing options (don't need to pay entire value up-front) The entered value can only be a lowercase y orn Display an appropriate error message if the entered value is not a y or n Validation must be nested in an iteration construct repeating until a valid value is entered 7. After storing the data to parallel array's, display a formatted table of the data entered Use the following printf statements for the table header: printf("Item Priority Financed Cost "); printf("-- -- "); Use the following printf formatting to display each wish list item record: printf("%3d %5d %5C %11.21f ", 8. After all the data is displayed, summarize it with the total of all the item costs. Use the following printf statement to properly align it with the appropriate Cost column: printf("- --- "); printf(" $%11.21f ", ... 9. Finally, before ending the application, display an exit message Part-1 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: $6500.50 How many wish list items do you want to forecast?: O 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?: 3 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 Priority Financed Cost n 1 2 3 1 3 2 n 39030.15 1200000.00 350500.25 $ 1589530.40 Best of luck in all your future endeavours

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

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions