Solved by Expert Tutors
Converse a RainFallclassthat has the following field:
Solved by Expert Tutors
Question

Converse a RainFall class that has the following field:<br/><br/><br/>•

an array of doubles that stores the rainfall for each of the 12 months of
the year (where the first index corresponds with January, the second with
February, etc.)


The class should also have the following methods:


• a method that returns the total rainfall for the entire year
• a method that returns the average monthly rainfall for the year
• a method that returns the month with the most rain as a string
• a method that returns the month with the least rain as a string


Demonstrate the class in a program that takes 12 doubles from the user (take the
doubles in the order of the months of the year, the first corresponding to the
rainfall in January, etc.). Do input validation: if the user inputs a negative
number, ignore it and continue asking them for input until you have 12
nonnegative doubles.


Once the user has given you all 12 doubles, an instance of the RainFall
class and call its methods, printing out the total rainfall, the average
monthly rainfall, the month with the most rain, and the month with the least
rain, each on a separate line.


This is what should print:
Enter·rainfall·for·month·1:1.12↵
Enter·rainfall·for·month·2:2.24↵
Enter·rainfall·for·month·3:3.36↵
Enter·rainfall·for·month·4:0.48↵
Enter·rainfall·for·month·5:2.00↵
Enter·rainfall·for·month·6:5.00↵
Enter·rainfall·for·month·7:12.12↵
Enter·rainfall·for·month·8:1.48↵
Enter·rainfall·for·month·9:3.12↵
Enter·rainfall·for·month·10:3.24↵
Enter·rainfall·for·month·11:6.6↵
Enter·rainfall·for·month·12:1.12↵
41.88↵
3.49↵
July↵
April↵

Step-by-step answer

ac, dictu


llent

ac, dictum vitae odio. Donec aor nea. Fusce dui lectus,conlonecsque dapibusongue vedictum vitae oitur lfacilisis. Pellentesque dapibus efficitur laDonec am idictum vitm ia molem iinia pspulvxfficsnecssus antssque dapisrem ipsumac, dictum vitae odio. Donec aliquet. Lorems a molestsrisus antiscionec aliquet.dictum vitae osumi, ultricxipsumia pulvinaririsus ante, dapibus a molestiecegue vel laoreet ac, dictum vitae odio. Donec aliquipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesqudictum vitae osumiongueiacinia pulvicimolestie consequat, ultrices acitur let, consect0facilisis. Pellentesque dapibusic,iasqu0molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsumor nea molestie consequat, ultrices ac manec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus antdictum vitae osumiongueinec facilisis. Pelleicimolestie consequat, ultrices acitur lur laoreet. Nam risus ante, dapibus a moitur lrisus0ac, dictum vitae odio. Donec aliaur laoreet. Nam risus ante, dapibus a molestie consequaic,iasqu0ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pelor neipiscing elit. Nam lacinia pulvinar torlestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoredictum vitae osuma moleiscing eliticimolestie consequat, ultrices aciaa molesti0facilisis. Pellentesque dapibusic,iasqu0risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lecuitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitaeor neo. Donec aliquet. Lorem ipsum dolors a molestie consequat, ultrices ac magna. Fusce dui lectus, congue veldictum vitae osuma moleitur laoreeticimolestie consequat, ultrices aciaa molesti0m risus ante, dapibus a molestieic,iasqu0a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Doneua. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit.or necing elit. Nam lacinia pulvinar tortor nec fasumiametiur liceonec aliquet.iur laoreet. Nam risus ante, dapibus a molestiesugue vel laoreet ac, dictum vitae odio. Donec aliquetitur licnecuscsulitur loinicitur laoreet. Nam risus ante, dic,iallen0a. Fuscenecnec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibuinia pulvinar tortor nec facing efur lac,usce dui lectus, congue vel laoreet ac, dictum vnecctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, cm ips,itura. Fusce dui lectus, congue vel laoreet ac, dictum vitu,necec fac0cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lainia pulvinar tortor nec facing efur lac,trices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitnecec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvonececng elur laoreet. Nam risus ante, dapibus a molestie consequat, usus ante, dnec facilisis. Pellentesque dapibus efficitur laoreetipsum dolor sit amet, consecteturm ipsum dolor sit amet, consectetur adipiscingsuconsectetunecentesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie cousceat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Luscecing elit. Nam lacinia pulvinar tortor nec fao. Donec ali

rem ipsum dolor sit


s a molestie consequat, ultrices ac mag

facilisis. Pitur lfacilisis. Pellentesque dapibus efficitur laDonec am idictum vitm ia molem iinia pspulvxfficsnecssus antssque dapisrem ipsumac, dictum vitae odio. Donec aliquet. Lorems a molestsrisus antffi


trices ac magna. Fusce dui lectus, congue vel lao

facilisis. Psumi, ultricxipsumia pulvinaririsus ante, dapibus a molestieceamet, consectetur adipiscing elit. N


ng elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque

facilisis. Pipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesqudictum vitae osumiongueiacinia pulvicimolestie consequat, ultrices acitur let, consect0facilisis. Pellentesque dapibusic,iasqu0molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsumor negue vel laoreet ac, dic


congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem i

facilisis. Pnec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus antdictum vitae osumiongueinec facilisis. Pelleicimolestie consequat, ultrices acitur lur laoreet. Nam risus ante, dapibus a moitur lrisus0ac, dictum vitae odio. Donec aliaur laoreet. Nam risus ante, dapibus a molestie consequaic,iasqu0ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pelor neonec aliquet. Lorem ipsum


a. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet.

facilisis. Plestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoredictum vitae osuma moleiscing eliticimolestie consequat, ultrices aciaa molesti0facilisis. Pellentesque dapibusic,iasqu0risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lecuitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitaeor nes a molestie consequat, ultrices ac


cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus eff

acinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lao

dictum vitae osuma moleitur laoreeticimolestie consequat, ultrices aciaa molesti0m risus ante, dapibus a molestieic,iasqu0a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Doneua. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit.or nefficitur laoreet. Nam risus ant


Fusce dui lectus, congue vel laoreet

risus ante, dapibus a molestiitur licnecuscsulitur loinicitur laoreet. Nam risus ante, dic,iallen0a. Fuscenecnec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibuinia pulvinar tortor nec facing efur lac,usce dui lectus, congue vel laoreet ac, dictum vnecctum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, cm ips,itura. Fusce dui lectus, congue vel laoreet ac, dictum vitu,necec fac0cing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur lainia pulvinar tortor nec facing efur lac,trices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitnecec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvonececng elur laoreet. Nam risus ante, dapibus a molestie consequat, usus ante, dmolestie consequat, ultrices ac


a molestie consequat, ultrices ac

lestie consequat, ultipsum dolor sit amet, consecteturm ipsum dolor sit amet, consectetur adipiscingsuconsectetunecin



ur laoreet. Nam

tesque dapibus efficitur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet

Subscribe to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question