Questions from Starting Out With Java


Q: Allow a user to enter any number of double values up to

Allow a user to enter any number of double values up to 15. The user should enter 99999 to quit entering numbers. Display an error message if the user quits without entering any numbers; otherwise, di...

See Answer

Q: Write an application for Chapa’s Car Care Shop that shows a user

Write an application for Chapa’s Car Care Shop that shows a user a list of available services: oil change, tire rotation, battery check, or brake inspection. Allow the user to enter a string that corr...

See Answer

Q: Create an application that prompts a user for 10 integers and stores

Create an application that prompts a user for 10 integers and stores them in an array. The application should call five methods that in turn (1) display all the integers, (2) display all the integer...

See Answer

Q: Create a class named Salesperson. Data fields for Salesperson include an

Create a class named Salesperson. Data fields for Salesperson include an integer ID number and a double annual sales amount. Methods include a constructor that requires values for both data fields, as...

See Answer

Q: Create a CollegeCourse class. The class contains fields for the course

Create a CollegeCourse class. The class contains fields for the course ID (for example, CIS 210), credit hours (for example, 3), and a letter grade (for example, A). Include get and set methods for ea...

See Answer

Q: Write an application that allows a user to enter the names and

Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for names and birthdates until the user enters the sentinel value ZZZ for a n...

See Answer

Q: In Chapter 9, you created a DinnerEventDemo class that obtains user

In Chapter 9, you created a DinnerEventDemo class that obtains user data for an array of dinner events for Yummy Catering and allows the user to sort the events using various criteria. Now, modify the...

See Answer

Q: Create a personal phone directory that contains room for first names and

Create a personal phone directory that contains room for first names and phone numbers for 30 people. Assign names and phone numbers for the first 10 people. Prompt the user for a name, and if the nam...

See Answer

Q: Create a class named Purchase. Each Purchase contains an invoice number

Create a class named Purchase. Each Purchase contains an invoice number, amount of sale, and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set method for...

See Answer

Q: Create a class named Horse that contains data fields for the name

Create a class named Horse that contains data fields for the name, color, and birth year. Include get and set methods for these fields. Save the file as Horse.java. b. Create a subclass of Horse named...

See Answer