Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the step by step solution for the programming exercise 15 chapter 6 (CHAPTER 6, PROBLEM P... What is the step by step solution

What is the step by step solution for the programming exercise 15 chapter 6 (CHAPTER 6, PROBLEM P...

What is the step by step solution for the programming exercise 15 chapter 6 (CHAPTER 6, PROBLEM PE 15) from the book Java Programming 7TH edition by Jocey Farrell? Create a BabysittingJob Class for Georgette's Babysitting service. The class contains fields that holds the following: - A job number that contains six digits. the first two digits represent the year, and the last four digits represent a sequential number. For example, the first job in 2014 has a job number of 140001.

- A code number representing the employee assigned to the job. Assume that the code will always be 1, 2, or 3

-A name based on babysitter code. Georgette has three babysitters: (1) Cindy, (2) Greg, and (3) Marcia.

- The number of children to be watched. Assume that this number is always greater than zero.

-The number of hours in the job. Assume that all hour values are whole numbers

-The fee for the job. Cyndi is paid $7 per hour per child. Greg and Marcia are paid $9 an hour for the first child, and $4 per additional hour for each additional child. For example, if Greg watches three children for two hours, he makes 17 per hour two hours, or $34.

Create a constructor for the BabysittingJob Class that accepts arguments for the job number, babysitter code, number of children, and hours. The constructor determinates the babysitter name and fee for the job. Also include a method that displays every BabysittingJob object fields as BabysittingJob.Java.

Next, create an application that prompts the user for data for a babysitting job. Keep prompting the user for each of the following values until they are valid:

-A four-digit year between 2013 and 2025 inclusive

- A job number for the year between 1 and 9999 inclusive

- A babysitter code of 1, 2, or 3 - A number of children the job between 1 and 9 inclusive

- A number of hour between 1 and 12 inclusive.

When all the data entries are valid, construct a job number from the last two digits of the year and a four digits sequential number (which might require leading zeroes) Then, the construct a Babysitting object, and display its values. Save the file as CreateBabysittingJob.Java

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Core Ios Developer S Cookbook Core Recipes For Programmers

Authors: Erica Sadun ,Rich Wardwell

5th Edition

0321948106, 978-0321948106

More Books

Students also viewed these Programming questions

Question

What are the two key measures of liquidity? Explain each measure.

Answered: 1 week ago