Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

The problem Write a RainFall class that stores the total…

Customer Question
The problem Write a RainFall class...
The problem
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have methods that return the following:the total rainfall for the year
the average monthly rainfall
the month with the most rain
the month with the least rain
Demonstrate the class in a complete program.
Input Validation: Do not accept negative numbers for monthly rainfall figures.I have the pure class for this problem and want to come out an application class which uses Scanner class to ask users to fill in their monthly rainfall. Make the application class short and easy.Here is the pure class, according to this, please help me to get an application class
/**
The Rainfall class stores data about a rainfall
for the Rainfall Class programming challenge.
*/public class Rainfall
{
private double[] rain; // Array to hold rainfall data
/**
Constructor
@param r An array of rainfall figures.
*/
public Rainfall(double r[])
{
// Create a new array.
rain = new double[r.length];
// Copy the argument's elements to the
// new array.
for (int i = 0; i < r.length; i++)
rain[i] = r[i];
}
/**
The getTotalRainFall method calculates the total
rainfall.
@return The total amount of rainfall.
*/
public double getTotalRainFall()
{
double total = 0.0; // Accumulator
// Accumulate the sum of the rain array elements.
for (int i = 0; i < rain.length; i++)
total += rain[i];// Return the sum.
return total;
}
/**
The getAverageRainfall method calculates the
average amount of rainfall.
@return The average amount of rainfall.
*/
public double getAverageRainFall()
{
return getTotalRainFall() / rain.length;
}/**
The getHighestMonth method determines the month
with the highest amount of rainfall.
@return The number of the month with the highest
amount of rainfall.
*/
public int getHighestMonth()
{
int highest = 0;
// Find the element with the highest value.
for (int i = 1; i < rain.length; i++)
{
if (rain[i] > rain[highest])
highest = i;
}
// Return the element number.
return highest;
}/**
The getLowstMonth method determines the month
with the lowest amount of rainfall.
@return The number of the month with the lowest
amount of rainfall.
*/
public int getLowestMonth()
{
int lowest = 0;
// Find the element with the lowest value.
for (int i = 1; i < rain.length; i++)
{
if (rain[i] < rain[lowest])
lowest = i;
}
// Return the element number.
return lowest;
}/**
The getRainAt method returns a specified value
in the array.
@param e The element number to return.
@return The value stored in the specified element.
*/
public double getRainAt(int e)
{
return rain[e];
}
}
Submitted: 7 months ago.Category: Homework
Show More
Show Less
Ask Your Own Homework Question
Answered in 2 hours by:
12/12/2017
Tutor: LogicPro, Engineer replied 7 months ago
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,499
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified

Hi

Ask Your Own Homework Question
Tutor: LogicPro, Engineer replied 7 months ago

Welcome

Download answer from here: http://wikisend.com/download/773628/RainFallClass.zip

Let me know if you need anything else or Leave your rating by selecting five stars located on the top right of the question page. Giving a positive rating compensates the Expert for their time with you. Please remember that your Expert will not be paid until you leave a positive rating for the answer. If the stars are grayed out or you cannot click on the stars to rate your experience, reply to your Expert and let them know so they can adjust your question and allow you to rate.

Please consider adding bonus after rating

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

You can also come back and add a bonus at a later date by using the "Write a review or give a bonus" button on your question page.

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 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!

LogicPro

Ask Your Own Homework Question
Tutor: LogicPro, Engineer replied 7 months ago
This answer is protected
Would you like to ask this question?
If you've already paid for this answer, simply Login.
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a tutorLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask LogicPro Your Own Question
LogicPro
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,499
13,499 Satisfied Customers
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML

LogicPro is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

13,499 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,556 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,698 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,190 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
Modify the program to add a function to sum the rainfall for
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 captu… read more
John
John
Software Engineer
509 satisfied customers
Assignment 1: Write a program that lets the user enter the
Assignment 1: Write a program that lets the user enter the total rainfall for each of 12 months into an array of doubles. The program should use two 12-element arrays. One array will hold strings, the… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Write static methods as follows: • double sum(double[] a) –
Write static methods as follows: • double sum(double[] a) – returns the sum of the entries in the array a. • double[] fill(int n, double v) – returns an array of n doubles, all of whose values are v. … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,499 satisfied customers
1- After compiling my java program, I have this error: illegal
1- After compiling my java program, I have this error: illegal character use 2- I have a help from Logic pro but I can't open the file URL=http://wikisend.com/download/588598/Grade Formatter 1.2.zip]G… read more
Ratheesh Ravi
Ratheesh Ravi
Master\u0027s Degree
114 satisfied customers
1)Create a class named Customer that implements IComparable
1)Create a class named Customer that implements IComparable interface. -Create 3 Customer class fields: Customer number, customer name, and amount due. Create automatic accessors for each field. -Crea… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Write a complete Java class that will create a 2D array of
Write a complete Java class that will create a 2D array of randomly generated ints that of size 5 rows and 10 columns. Print the values of each cell to a 5x10 table. Write a method that computes the a… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,499 satisfied customers
Write a generic class MyMathClass with at type parameter T
Write a generic class MyMathClass with at type parameter T where T is a numeric object (Integer, Double or any class that extends java.lang.number) Add a method standardDeviation (stdev) that takes an… read more
active1065
active1065
Bachelor
174 satisfied customers
Write a program that lets the user enter the total rainfall
Write a program that lets the user enter the total rainfall for each of the 12 months into an array of doubles. The program should calculate and display the total rainfall for the year, the average mo… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
This is the assignment given to me, I am having a difficult
This is the assignment given to me, I am having a difficult time with coding. Hence, why I am here. My professor has given me some partial code to "help" me. But once again, I am lost. Anyway, here is… read more
Expert
Expert
I need help with Pseudocode for a program that calculates the
I need help with Pseudocode for a program that calculates the following: the total rainfall for the year; the average rainfall for the year; the month with the most rain; the month with the least rain… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,499 satisfied customers
USE JAVA Phone Book Arraylist 1,Write a class named phoneBookEntry
USE JAVA Phone Book Arraylist 1,Write a class named phoneBookEntry that has fields for a person's name and phone number.The class should have a constructor and appropriate accessor and mutator methods… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,499 satisfied customers
Drink Machine SimulatorWrite a program that simulates a
Drink Machine Simulator Write a program that simulates a soft drink machine. The program should use a structure that stores the following data: Drink Name, Drink Cost and Number of drinks in Machine T… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
**LOGICPRO ONLY** Hello there, I have another two assignments
**LOGICPRO ONLY** Hello there, I have another two assignments due this week by Thursday 6 PM EST and was hoping you could help me again. Also, the last program you sent me had a couple of things that … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
13,499 satisfied customers
The C++ source file called debug_lab.cpp is intended to be
The C++ source file called debug_lab.cpp is intended to be a program that inputs monthly sales data and displays the high, low and average sales. Unfortunately, it doesn't work. There are three logica… read more
ATLProg
ATLProg
Sr Software Engineer
Master\u0027s Degree
46 satisfied customers
Inventory Program Part 2 Modify the Inventory Program so ...
Inventory Program Part 2 Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, in… read more
Scott
Scott
MIT Graduate
Master\u0027s Degree
213 satisfied customers
Modify the Inventory Program so the application can handle ...
Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, … read more
Scott
Scott
MIT Graduate
Master\u0027s Degree
213 satisfied customers
Modify the Inventory Program so the application can handle ...
Modify the Inventory Program so the application can handle multiple items. Use an array to store the items. The output should display the information one product at a time, including the item number, … read more
Scott
Scott
MIT Graduate
Master\u0027s Degree
213 satisfied customers
I need the answers to exercises in Introduction to Java ...
I need the answers to exercises in Introduction to Java Programming the 6th Edition by Y.XXXXX XXXXXang… read more
Scott
Scott
MIT Graduate
Master\u0027s Degree
213 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x