Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Code in C language. Arrays of Prices and Letters. Create two constants to be used to set the sizes of two arrays with values of
Code in C language. Arrays of Prices and Letters.
- Create two constants to be used to set the sizes of two arrays with values of 10 and 26, e.g., #define PRICE_SIZE 10.
- Create an array to store 10 prices and initialize all the values to zeros, appropriately, e.g., double price[...] = {0}; where the ellipse is the appropriate constant from step 2.
- Create an array to hold 26 characters and initialize all the values to zeros; see step 3 adjusting it appropriate for the English alphabet.
- Create a typical for loop for processing an entire array, which ask for and stores 10 prices into the first array, e.g., for (i = 0; i < ...; i++) {...}, where the first ellipse is the appropriate constant from step 2 and the second ellipse is the code needed inside the loop to get 10 prices from the user.
- Create a typical for loop, which ask for and stores the English alphabet; see step 5 adjusting things appropriately.
- Create a typical for loop, which displays the 10 prices using the indices, complete sentences, and lined up on the decimal points, e.g., Price 1 is $ 10.69; see step 5 adjusting the code inside the loop appropriately. Hint: You will need 8 columns for the second format specifier to line up the decimal points. This will allow for the largest number to be 99999.99.
- Create a typical for loop, which displays the entire alphabet using the indices and complete sentences, e.g., Letter 1 is A; see step 5 adjusting the code inside the loop appropriately.
- Make sure your output looks professional, e.g., put a blank line between getting the input and display the results, i.e., between the different parts of the output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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