EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 6, Problem 12PE

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

Blurred answer
Students have asked these similar questions
Write an application that determines whether a phrase entered by the user is a palindrome. A palindrome is a phrase that reads the same backward and forward without regarding capitalization, spaces or punctuation. And it will allow the user to enter as many phrases as he likes after each iteration.
using java (Use the Date class) Write a program that creates a Date object, sets its elapsedtime to 10000, 100000, 1000000, 10000000, 100000000, 1000000000,10000000000, and 100000000000, and displays the date and time using thetoString() method, respectively.
write an application that reads English-Language phrase and encodes it into morse code. also write an application that reads a phrase in morse code and converts it into the English-Language equivalent . Use one blank between each Morse-code letter and three blanks between each Morse-coded word.
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY