Answered step by step
Verified Expert Solution
Link Copied!

Question

00
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.

  1. 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.
  2. 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.
  3. Create an array to hold 26 characters and initialize all the values to zeros; see step 3 adjusting it appropriate for the English alphabet.
  4. 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.
  5. Create a typical for loop, which ask for and stores the English alphabet; see step 5 adjusting things appropriately.
  6. 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.
  7. 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.
  8. 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

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions