Predict the size of a population of organisms

Assignment Help JAVA Programming
Reference no: EM132057194

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 daily population increase (as a percentage, expressed as a fraction in decimal form: for example 0.052 would mean a 5.2% increase each day), and the number of days they will multiply. A loop should display the size of the population for each day.

Prompts, Output Labels and Messages.The three input data should be prompted for with the following prompts: "Enter the starting number organisms: ", "Enter the daily increase: ", and "Enter the number of days the organisms will multiply: " respectively. After the input has been read in successfully, a table is produced, for example:

----------------------------

2            300.0

4            675.0

Under the heading is a line of 29 dashes followed by one line for each day, showing the day number and the population at the beginning of that day.

Input Validation.Do not accept a number less than 2 for the starting size of the population. If the user fails to satisfy this print a line with this message "Invalid. Must be at least 2. Re-enter: " and try to read the value. Similarly, do not accept a negative number for average daily population increase, using the message "Invalid. Enter a non-negative number: " and retrying. Finally, do not accept a number less than 1 for the number of days they will multiply and use the message "Invalid. Enter 1 or more:".

Reference no: EM132057194

Questions Cloud

Familiarity with the eclipse environment : After you gain familiarity with the Eclipse environment, you are going to create a very simple Java program, and run it using Eclipse.
Member variable of type double : Define a class named Payment that contains a member variable of type double that stores the amount of the payment and appropriate accessor and mutator methods
Demonstrate the class in a program that contains a car : Demonstrate the class in a program that contains a Car object, and then calls the accelerate method five times. After each call to the accelerate method
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

Reviews

Write a Review

JAVA Programming Questions & Answers

  Describe your methodology and service level agreements

How often do you have down time? How often do you upgrade software/hardware? Describe your methodology and service level agreements.

  In java programming objects are stored on stack

In java programming Objects are stored on Stack. True/False

  The project involves benchmarking the behavior of java

The project involves benchmarking the behavior of Java implementations of one of the following sorting algorithms, bubble sort, selection sort, insertion sort, Shell sort, merge sort, quick sort or heap sort. You must post your selection in the "Ask ..

  Write a java program that provides the pilots

CSE1OOF/4OOF - Write a Java program called Landing.java that provides the pilots with a way of controlling the orbital ferries

  Part - a1nbsp to compile and run a java source file

part - a1.nbsp to compile and run a java source file hello.java that contains a main method which of the following are

  This project mainly focuses on explaining your

this project focuses on demonstrating your understanding of java collections. before attempting this project be sure

  Determine the purpose of using javascriptr on a website

write a 200- to 300-word short-answer response to the followingwhat is the purpose of using javascriptr on a website?

  Develop a program that implement the seven array methods

Develop a program that Implement the 7 array methods and performs the same thing, but instead use a multi-dimensional array.

  Create java program to find number of days left in that year

Create a Java program called "DaysLeftInYear.java" that outputs the number of days left in that year. use the calendar class to represent dates. Use the DateFormat class to display the current date in the output.

  Write a recursive method to reverse a string.

write a recursive method to reverse a string. Explain why you would not normally use recursion to solve this problem?

  Writing a program that implements an atm machine

Writing a program that implements an ATM machine. The interface to the program should be a Java GUI that looks similar

  Write a test program that obtains from the user

Write a test program that obtains from the user the items to store in two sets A and B, and displays the union A u B, the inter- section A n B, and the dierence A \ B. The data type of the items is your choice. ( you can only store objects.)

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