Demonstrate the class in a program that takes 12 doubles

Assignment Help JAVA Programming
Reference no: EM132057191

RainFall class that has the following field:

  • anarrayofdoublesthatstoresthe 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:

  • amethodthat returns the total rainfall for the entire year
  • amethodthat returns the average monthly rainfall for the year
  • amethodthat returns the month with the most rain as astring
  • amethodthat returns the month with the least rain as astring

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

Reference no: EM132057191

Questions Cloud

Create a very simple four function integer calculator : Create a very simple four function integer calculator with buttons for Add, Subtract, Multiply, and Divide, and with two text-type input fields.
Predict the size of a population of organisms : Program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average
Create the program for an atm machine : How can we create the program for an ATM MACHINE to perform the following tasks
Looking for help setting-up a java class : Looking for help setting-up a Java class, with the following requirements:
Demonstrate the class in a program that takes 12 doubles : 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
Java application based on your pseudo code : Can somebody help me write out a pseudo code, and help me solve the following according to the pseudo code
Principal components involved in developing a program : What are the principal components involved in developing a program? Describe the benefits of breaking up a program into small modules and provide an example
Create a class named app : Create a class named App1 which provides a GUI window. Users will enter 24-bit RGB color values and the window will then display them.
Describe a potential consequence of that declaration : Pick one of the following declarations and discuss why the variable name is "bad." Describe a potential consequence of that declaration.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create a hotel management web application

CSCE 464/864 - Spring 2016 - Create a hotel management web application that can be used by two types of users: customers and clients. A customer is a user who intends to search for hotels and make reservations.

  Create a new project in eclipse

Implement the system using the given design and make sure that all the unit tests pass against your code - You must implement the system

  Calculates and displays cost of computing infrastructure

Calculates and displays the cost of computing infrastructure setup - The application should ask the user to enter the number of computers for each bank (total N banks) and calculate the cost.

  Computes and prints the total cost of the three items

A program is required which prompts the user to enter the individual price of three different items and computes and prints the total cost of the three items as well as the average cost. Remember to add sales tax (5% or 0.05) to the total cost.

  Algorithm analysis with advanced data structures

Algorithm Analysis with Advanced Data Structures, Your good friend, a Rock Star, asked you to create a Time Manager app for him, The Rock Star performs gigs at certain dates, all around the country - at most one gig per day

  Create java program to calculate the net pay for an employee

Create a Java Program to calculate the net pay for an employee. In this payroll program, you will need to allow the user to input the following information Input your First Name: Elmer.

  Design a class to represent a credit card

This material is somewhat more theoretical than that of previous topics, so instead of writing a program for this assignment, you are going to work on a design

  Compare the total annual compensation of two salespersons

The application will now compare the total annual compensation of at least two salespersons. There should be proper documentation in the source code.

  Structures that can be used in programming

There are various selection structures that can be used in programming. What are the different selection structures that can be used in the Java programming

  Balancing binary search trees

Balancing Binary Search Trees,  Consider the file BST.java (a link to this file is provided below for downloading purposes) which defines a generic Binary Search Tree class.

  Write a java class which allows to vote by party affiliation

Write a Java class (VotingMachine.java) which allows one to vote by party affiliation and will also allow us to query the number of votes for each party and who won the election.

  Write a java program to simulate a calculator

Write a JAVA program to simulate a calculator. Your program should take two numbers and an operator (+,-,*,or/), from the user in the following format: number1 operator number2 (For example 5.6 + 7.2) and print the result.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd