Solve this problem using pointer variables for parameter passing, where appropriate and pointer arithmetic when working...

60.1K

Verified Solution

Question

Programming

Solve this problem using pointer variables for parameterpassing, where appropriate and pointer arithmetic when working witharrays

Please use the \"C\" program toProduce theEXACT output shown at the end of the document.

1.Generate a graph that compares, on a month-by-month basis, themonthly rainfall for Kamloops for the first half of 2018 (i.e. Jan– June) versus the normal (30 year average) rainfall for Kamloopsfor the same months.

  1. In main( ), create the 2 data arrays using initializationslists, and also create this array char *months[6] = { \"January\",\"February\", \"March\", \"April\", \"May\", \"June\" };   
  2. Create and call ONE function to print one line of symbols.
    • call it the first time to print the line of *
    • call it a second time to print the line of !
    • no if statement is needed or allowed in this function
    • Think very carefully about the parameter list for thisfunction

  1. Call a function to print the scale and the legend as shownbelow.
  1. Call a function to find and print the total rainfall for eachdata set, and also the comparison of the two totals. The functionwill state whether 2018 was wetter, drier, or equal to a normal 6month rainfall and by how much.
  1. Call a function to determine which month in 2018 had thehighest rainfall, and print the month name (using thefunction described in #2), the rainfall amount and howthat amount compares to the normal amount for that month.

Input will consist of 6 pairs of numbers representing the normalrainfall for the month and the 2018 rainfall amount for the samemonth. Use the exact data shown below when you run your program,(Note: the data and output below are for illustrationpurposes only. Your program must be able to work with any data thathas this format)

  1. 3.15.4       ¬ January data (normalfirst, then 2018)
  2. 4.74.4      ¬ February data
  3. 4.2 4.1
  4. 5.0   6.0
  5. 4.0   5.6
  6. 6.3    4.5

Rainfall comparison for January to June 2018

       January   |***********

|!!!!!!!!!!!!!!!!!!!!!!!!!

|  

   February |***************

|!!!!!!!!!!!!!!!!!!!!!

|

   March | etc for the rest of the months

|  

       

June |*****************

|!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

|----1----2----3----4----5----6----7----8

LEGEND:

* - normal rainfall for a givenmonth

! - 2018 rainfall for a givenmonth

Total normal rainfall was xx.x mm.

Total rainfall for 2018 was yy.ymm.

2018 was a drier year than normal byz.z mm. (or print wetter or equal if that isappropriate)

The month in 2018 with the highest rainfall was …

Answer & Explanation Solved by verified expert
3.7 Ratings (404 Votes)
IF YOU HAVE ANY DOUBTS COMMENT BELOW I WILL BE THERE TO HELP YOU ANSWER CODE include one function to print the lines of symbols void oneFunctiondouble rainAmt char c int sizerainAmt02 for int i 0 i size i printfc c Function to call scale and legend void scaleAndLegend Generates the ruler at the bottom of the scale printf19s12345678 Generates legend at the end of scale printf Legend printf printf Normal rainfall for a given month printf printf 2018 rainfall for a given month double    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