Questions from Starting Out With Java


Q: Write an application that includes final constants named START and STOP that

Write an application that includes final constants named START and STOP that are set to 5 and 500, respectively. The application counts by five from 5 through 500 inclusive, and it starts a new line a...

See Answer

Q: Write an application that prompts a user for the number of years

Write an application that prompts a user for the number of years the user has until retirement and the amount of money the user can save annually. If the user enters 0 or a negative number for either...

See Answer

Q: Write an application that asks a user to type an even number

Write an application that asks a user to type an even number or the sentinel value 999 to stop. When the user types an even number, display the message Good job! and then ask for another input. When t...

See Answer

Q: Write an application that displays the factorial for every integer value from

Write an application that displays the factorial for every integer value from 1 to a user-entered limit. A factorial of a number is the product of that number multiplied by each positive integer lower...

See Answer

Q: Write an application that prompts a user for two integers and displays

Write an application that prompts a user for two integers and displays every integer between them. Display a message if there are no integers between the entered values. Make sure the program works re...

See Answer

Q: Write an application that displays every perfect number from 1 through a

Write an application that displays every perfect number from 1 through a user-supplied limit. A perfect number is one that equals the sum of all the numbers that divide evenly into it. For example, 6...

See Answer

Q: In previous chapters, you have created a number of programs for

In previous chapters, you have created a number of programs for Yummy Catering. Now, create an interactive GUI program that allows the user to enter the number of guests for an event into a text field...

See Answer

Q: Write an application that prompts the user for a single-digit

Write an application that prompts the user for a single-digit integer and uses a loop to create the pattern shown in the example in Figure 6-32. In the example, the user entered a 3, and 10 lines are...

See Answer

Q: Write an application that asks a user to enter an integer.

Write an application that asks a user to enter an integer. Pass the integer to a method that determines whether the number is even and returns a Boolean value. Display a statement that indicates wheth...

See Answer

Q: Write an application that asks a user to enter three integers.

Write an application that asks a user to enter three integers. Display them in ascending and descending order. Save the file as AscendingAndDescending.java.

See Answer