Explanation of Solution
Program:
File name: “Population.java”
//Define a class named Population
public class Population
{
//Define main method
public static void main(String[] args)
{
//Declare variables and initialize the values
//set growth rate in percent
double RATE_OF_GROWTH_OF_MEXICO=0.0101;
//set decay rate in percent
double RATE_OF_DECAY_OF_USA=0.0015;
//set years
int years=1;
//Set Mexico population as 128 million
double mexicoPopulation=128000000;
//Set USA population as 323 million
double usaPopulation=323000000;
//Print the result
System.out.printf("%-10s%-20s%-15s\n","Years","Mexico","USA");
/*While condition that checks if the Mexico
population is less than USA population */
while (mexicoPopulation<usaPopulation)
{
//Print the result
System...
Trending nowThis is a popular solution!
- . Write an application for a college’s admissions office. Prompt the user for a student’s numeric high school grade point average (for example, 3.2) and an admission test score from 0 to 100. Display the message “Accept” if the student has any of the following: A grade point average below 3.0 and an admission test score of at least 80 If the student does not meet either of the qualification criteria, display “Reject”. Save the file as Admission.java.arrow_forwardWrite an application that asks the user to enter two integers and displays "The two numbers you entered are: ", followed by the larger integer.arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,