Homework

# 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.
}
/**
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: 4 months ago.Category: Homework
Show More
Show Less
12/12/2017
Tutor: LogicPro, Engineer replied 4 months ago
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,422
Experience: Expert in Java C++ C C# VB Javascript Design SQL HTML
Verified

Hi

Tutor: LogicPro, Engineer replied 4 months ago

Welcome

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.

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.

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

Thank you for using this site!

LogicPro

Tutor: LogicPro, Engineer replied 4 months ago
Would you like to ask this question?
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13,422
13,422 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

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

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

Engineer

13,422 satisfied customers

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

Manal Elkhoshkhany

Tutor

4,551 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

M.S.W. Social Work

2,636 satisfied customers

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

F. Naz

Chartered Accountant

2,161 satisfied customers

Experience with chartered accountancy

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Tutor

1,781 satisfied customers

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

< Previous | Next >

Related Homework Questions
I need help with a homework a tutor just gave me today. its
i need help with a homework a tutor just gave me today. its about electrical estimating and its due for tomorrow!… read more
Chris M.
M.S.W. Social Work
Master's Degree
2,636 satisfied customers
Looking for psycology homework help. Somethibg along these
Looking for psycology homework help. Somethibg along these lines.These videos are specifically targeted to teens and young adults. The focus of this question is identity formation and emotional develo… read more
GLENN
Master of Mathematics
390 satisfied customers
Need help with some data communication/networking homework
Need help with some data communication/networking homework questions. The priority is question 1 and 2e. Thanks… read more
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
My son is sick and I have homework to get done and no time
My son is sick and I have homework to get done and no time to finish … read more
judybailey52
Bachelors degree
881 satisfied customers
For this homework, you are to make a Form that will hold
For this homework, you are to make a Form that will hold input fields for allowing a user to set the begin and end dates of a potential tour. This form will submit the information to a Servlet, which … read more
LogicPro
Engineer
13,422 satisfied customers
I'm working on a program for a homework assignment and I
I'm working on a program for a homework assignment and I can't figure out why it's not working. I've tried finding help online but am not having any success. … read more
LogicPro
Engineer
13,422 satisfied customers
I have some production and operations homework.. can you
Hi! I have some production and operations homework.. can you help me? … read more
GLENN
Master of Mathematics
390 satisfied customers
Cher
Masters Degree
1,382 satisfied customers
PYTON homework. Write a function that counts the number of
Write a function that counts the number of alphabetic characters (a through z, or A through Z) in your text and then keeps track of how many are the letter ‘a'. Your function should print an analysis of the text like this: Your text contains 232 alphabetic characters, of which 24.8% are 'a'.2. [10 points] Write a function that implements a substitution cipher. In a substitution cipher one letter is substituted for another to garble the message. For example A -> Q, B -> T, C -> G etc. your function should take two parameters, the message you want to encrypt, and a string that represents the mapping of the 26 letters in the alphabet. Your function should return a string that is the encrypted version of the message.For example, if your text is 'abc Franklin Student', and your mapping is 'abcdefghijklmnopqrstuvwxyz' to 'bcdefghijklmnopqrstuvwxyza' which means a is going to be replaced by b, b is going to be replaced by c and so on. Same rules apply for upper case letters. A is going to be replaced with B, and so on.Your program should print the encrypted version of 'abc Franklin Student', which is: bcd Gsbolmjo Tuvefou … read more
Ingo U
Master\u0027s Degree
509 satisfied customers
Just trying to figure this homework excel sheet out. Well i
just trying to figure this homework excel sheet out … read more
GLENN
Master of Mathematics
390 satisfied customers
NOTE: This question is a homework given by the same
NOTE: This question is a homework given by the same professor. It does not violate any honor code because same question is repeatedly asked different students. DO NOT FLAGCase Study #1: Technology & P… read more
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,161 satisfied customers
I have some trigonometry homework i need done. consists of
I have some trigonometry homework i need done. consists of about 20 questions on the first exam. and 20 on the second.… read more
GLENN
Master of Mathematics
390 satisfied customers
I need help on my computer science homework using python i
I need help on my computer science homework using python i have hit a speed bump and do not understand what i am doing with my functions anymore... i feel like all my files are set and i have red the … read more
LogicPro
Engineer
13,422 satisfied customers
I would ask this in homework but I think this is out of
Hi,I would ask this in homework but I think this is out of their area of expertise. How much to answer these 40 electrician trade school questions from Penn foster. This is their NEC graded project wh… read more
Dr. Donna Kakonge
Doctor of Education
201 satisfied customers
Hope all is well. Need assistance on a homework assignment.
Hi, this is Brian hope all is well. Need assistance on a homework assignment. I'm coding a program in JavaScript language and need assistance in getting it to run. I have the container and code for th… read more
LogicPro
Engineer
13,422 satisfied customers
For logic Pro only. I need help with m database homework. I
For logic Pro only. I need help with m database homework. I need to create a physical model using the access database system.… read more
LogicPro
Engineer
13,422 satisfied customers
I need assistance with this homework Joe's Automotive
hi i need assistance with this homework Joe's Automotive performs the following routine maintenance services: • Oil change—\$36.00 • Lube job—\$28.00 • Radiator flush—\$50.00 • Transmission flush—\$120.00… read more
Dr. Donna Kakonge
Doctor of Education
201 satisfied customers
Mrs.kellymaharaj claims that doing all their homework daily
Mrs.kellymaharaj claims that doing all their homework daily on time will help students perform better in biology class. Design an experiment to evaluate her claim, with independent variable, dependent… read more
GLENN
Master of Mathematics
390 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