How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13074
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Overview This hands-on lab allows you to follow and

Customer Question

Overview This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, analysis, test plan, and implementation with C code. The example provided uses sequential, repetition, selection statements, functions, strings and arrays.
Program Description
This program will input and store meteorological data into an array. The program will prompt the user to enter the average monthly rainfall for a specific region and then use a loop to cycle through the array and print out each value. The program should store up 5 years of meteorological data. Data is collected once per month. The program should provide the option to the user of not entering any data.
Test Plan
To verify this program is working properly the input values could be used for testing:
Test Case
Input
Expected Output
1
Enter data? = y
1.2
2.2
3.3
2.2
10.2
12.2
2.3
0.4
0.2
1.1
2.1
year month rain
2011 Jan 1.20
2011 Feb 2.20
2011 Mar 3.30
2011 Apr 2.20
2011 May 10.20
2011 Jun 12.20
2011 Jul 2.30
2011 Aug 0.40
2011 Sep 0.20
2011 Oct 1.10
2011 Nov 2.10
2011 Dec 0.40
2
0.4
1.1
2.2
3.3
2.2
10.2
12.2
2.3
0.4
0.2
1.1
2.1
0.4
1.1
2.2
3.3
2.2
10.2
12.2
2.3
0.4
0.2
1.1
2.1
0.4
1.1
2.2
3.3
2.2
10.2
12.2
2.3
0.4
0.2
1.1
2.1
0.4
1.1
2.2
3.3
2.2
10.2
12.2
2.3
0.4
0.2
1.1
2.1
0.4
2012 Jan 1.10
2012 Feb 2.20
2012 Mar 3.30
2012 Apr 2.20
2012 May 10.20
2012 Jun 12.20
2012 Jul 2.30
2012 Aug 0.40
2012 Sep 0.20
2012 Oct 1.10
2012 Nov 2.10
2012 Dec 0.40
2013 Jan 1.10
2013 Feb 2.20
2013 Mar 3.30
2013 Apr 2.20
2013 May 10.20
2013 Jun 12.20
2013 Jul 2.30
2013 Aug 0.40
2013 Sep 0.20
2013 Oct 1.10
2013 Nov 2.10
2013 Dec 0.40
2014 Jan 1.10
2014 Feb 2.20
2014 Mar 3.30
2014 Apr 2.20
2014 May 10.20
2014 Jun 12.20
2014 Jul 2.30
2014 Aug 0.40
2014 Sep 0.20
2014 Oct 1.10
2014 Nov 2.10
2014 Dec 0.40
2015 Jan 1.10
2015 Feb 2.20
2015 Mar 3.30
2015 Apr 2.20
2015 May 10.20
2015 Jun 12.20
2015 Jul 2.30
2015 Aug 0.40
2015 Sep 0.20
2015 Oct 1.10
2015 Nov 2.10
2015 Dec 0.40
Please try the Precipitation program again.
2
Enter data? = n
No data was input at this time.
3
Please try the Precipitation program again.
C Code
The following is the C Code that will compile in execute in the online compilers.
// C code
// This program will input and store meteorological data into an array.
// Developer: Faculty CMIS102
// Date: Jan 31, XXXX
#define NUMMONTHS 12
#define NUMYEARS 5
#include
// function prototypes
void inputdata();
void printdata();
// Global variables
// These are available to all functions
float Raindata[NUMYEARS][NUMMONTHS];
char years[NUMYEARS][5] = {"2011","2012","2013","2014","2015"};
char months[NUMMONTHS][12] ={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
int main ()
{
char enterData = 'y';
printf("Do you want to input Precipatation data? (y for yes)\n");
scanf("%c",&enterData);
if (enterData == 'y') {
// Call Function to Input data
inputdata();
// Call Function to display data
printdata();
}
else {
printf("No data was input at this time\n");
}
printf("Please try the Precipitation program again. \n");
return 0;
}
// function to inputdata
void inputdata() {
/* variable definition: */
float Rain=1.0;
// Input Data
for (int year=0;year < NUMYEARS; year++) {
for (int month=0; month< NUMMONTHS; month++) {
printf("Enter rain for %d, %d:\n", year+1, month+1);
scanf("%f",&Rain);
Raindata[year][month]=Rain;
4
}
}
}
// Function to printdata
void printdata(){
// Print data
printf ("year\t month\t rain\n");
for (int year=0;year < NUMYEARS; year++) {
for (int month=0; month< NUMMONTHS; month++) {
printf("%s\t %s\t %5.2f\n", years[year],months[month],Raindata[year][month]);
}
}
}
Setting up the code and the input parameters in ideone.com:
You can change these values to any valid integer values to match your test cases.
Add results from running the programming at ideone.com
Learning Exercises for you to complete
1.Modify the program to add a function to sum the rainfall for each year. (Hint: you need to sum for each year. You can do this using a looping structure). Support your experimentation with screen captures of executing the new code.
2.Enhance the program to allow the user to enter another meteorological element such as windspeed (e.g. 2.4 mph). Note, the user should be able to enter both rainfall and windspeed in your new implementation. Support your experimentation with screen captures of executing the new code.
3. Prepare a new test table with at least 2 distinct test cases listing input and expected output for the code you created after step 2.
4. What happens if you change the NUMMONTHS and NUMYEARS definitions to other values? Be sure to use both lower and higher values. Describe and implement fixes for any issues if errors results. Support your experimentation with screen captures of executing the new code.
Submitted: 1 year ago.
Category: Homework
Expert:  LogicPro replied 1 year ago.

Hi,

What is the deadline?

Customer: replied 1 year ago.

Deadline is 3/1/16

Expert:  LogicPro replied 1 year ago.

Looking at the efforts, I am sending small revised offer. let me know once you accept it.

Customer: replied 1 year ago.

OK thank you

Expert:  LogicPro replied 1 year ago.

let me know once you accept the offer

Customer: replied 1 year ago.
I am having issues with accepting the offer - I will attempt to accept once I get home tonight.
Expert:  LogicPro replied 1 year ago.

Here are customer support numbers

US/Canada 1.***-***-****

Available 6am to 9pm PST

International

Australia 1800-679-634

New Zealand 0800-452-621

United Kingdom 0***-***-****

The rest of the world 1-***-***-****

Expert:  LogicPro replied 1 year ago.

ok, I will provide you answer.

Expert:  LogicPro replied 1 year ago.

Download answer from here: http://www.wikisend.com/download/654052/Rainfall_code_output.docx

Just posted the answer Link

Let me know once you got it

Please consider adding bonus

http://ww2.justanswer.com/help/what-if-expert-does-really-fantastic-job-hl

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers. It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Thank you for using this site!

Expert:  LogicPro replied 1 year ago.

Hi again,

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Just following up with you to see how everything is going and if you have more questions for me.

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.

I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!

Thanks very much for using Just Answer!

Best wishes

LogicPro

Expert:  LogicPro replied 1 year ago.

Hi again,

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Just following up with you to see how everything is going and if you have more questions for me.

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.

I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!

Thanks very much for using Just Answer!

Best wishes

LogicPro

Expert:  LogicPro replied 1 year ago.

Hi again,

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Just following up with you to see how everything is going and if you have more questions for me.

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.

I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!

Thanks very much for using Just Answer!

Best wishes

LogicPro

Expert:  LogicPro replied 1 year ago.
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.

Related Homework Questions