Questions from Starting Out With Java


Q: Create a class named BaseballGame that contains data fields for two team

Create a class named BaseballGame that contains data fields for two team names. Include a two-dimensional array that can hold the scores for each of two teams in each inning of the game. The Basebal...

See Answer

Q: Create a class named Pizza with a String array data field that

Create a class named Pizza with a String array data field that can hold the names of up to 10 pizza toppings. Also include a field for the price. Include a constructor that takes two parameters: the a...

See Answer

Q: Create a class named Rock that acts as a superclass for rock

Create a class named Rock that acts as a superclass for rock samples collected and catalogued by a natural history museum. The Rock class contains fields for a number of samples, a description of the...

See Answer

Q: Create an abstract class named Book. Include a String field for

Create an abstract class named Book. Include a String field for the Book’s title and a double field for the book’s price. Within the class, include a constructor that requires the book title, and add...

See Answer

Q: The Talk-A-Lot Cell Phone Company provides phone services

The Talk-A-Lot Cell Phone Company provides phone services for its customers. Create an abstract class named PhoneCall that includes a String field for a phone number and a double field for the price o...

See Answer

Q: Write an application named BadSubscriptCaught in which you declare an array of

Write an application named BadSubscriptCaught in which you declare an array of eight first names. Write a try block in which you prompt the user for an integer and display the name in the requested po...

See Answer

Q: Create a DataEntryException class whose getMessage() method returns information about

Create a DataEntryException class whose getMessage() method returns information about invalid integer data. Save the file as DataEntryException.java. b. Write a program named GetIDAndAge that continu...

See Answer

Q: Serendipity Gifts accepts user orders for its products interactively. Users might

Serendipity Gifts accepts user orders for its products interactively. Users might make the following errors as they enter data: ❯❯ The item number ordered is not nu...

See Answer

Q: Throughout the Case Problems in this course, you have been using

Throughout the Case Problems in this course, you have been using an Event class to store data about events for Yummy Catering. Now, create an application that prompts the user for details about eight...

See Answer

Q: In a “You Do It” section of this chapter,

In a “You Do It” section of this chapter, you created a CalculatorDemo program that asked the user to solve an arithmetic problem and provided the Windows system calculator for assistance. Now modify...

See Answer