Write a program in C to perform the following: Generates an array of 10 double random...

50.1K

Verified Solution

Question

Programming

Write a program in C to perform the following:

  • Generates an array of 10 double random values between 1.0 and100.0 – assume these are prices for 10 items that a storesells
  • Generates an array of 10 integer random values between 0 and200 – assume that these are the number of items/units (first array)sold
  • Generate another array called “itemSale” which would containthe total sale for each item.
  • Calculate the total sale for this store and display it
  • If the number of items sold is more than 100, notify the userthat this item (Item number from table below) needs to bereordered.
  • Display the following table:

Item                Price/unit         unitssold         Total

1                     33.45              2                     66.9

2                     435.22            5                     2176.1

3                     55.12              100                 551.2

..                     …                   …                   …

____________________________________________

Total store sale: ??????

Requirement

  1. Must use arrays
  2. Must create a functions to generate random numbers for eacharray
  3. Must use function to calculate the sale of each item
  4. Must use appropriate loop to traverse the arrays

Answer & Explanation Solved by verified expert
4.3 Ratings (542 Votes)
Codeincludeincludeincludedeclaring variablesint price10double item10    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students