Revise the class TimeBook in Listing 7.14 to use an enumeration for the days of the week
Question:
Revise the class TimeBook in Listing 7.14 to use an enumeration for the days of the week instead of named constants.
Listing 7.14
Transcribed Image Text:
Class that records the t ime worked by each of a company's employees during one five-day week. A sample application is in the main method. */ public class TimeBook { private int number0fEmployees; //hours[i][j] has the hours for //employee j on day i. private int[U] hours; private int[] weekHours; //weekHours [i] has the week's //hours worked for employee i + 1. private int [] dayHours; //dayHours[i] has the total hours //worked by all employees on day i. private static final int NUMBER_OF_WORKDAYS = 5; private static final int MON = 0; private static final int TUE private static final int WED private static final int THU = 3; private static final int FRI %3D 1: %3D 2; 43B %3!
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 88% (9 reviews)
ANSWER public class TimeBook private int numberOf Employees private int hours hoursij has the hours ...View the full answer
Answered By
Churchil Mino
I have been a tutor for 2 years and have experience working with students of all ages and abilities. I am comfortable working with students one-on-one or in small groups, and am able to adapt my teaching style to meet the needs of each individual. I am patient and supportive, and my goal is to help my students succeed.
I have a strong background in math and science, and have tutored students in these subjects at all levels, from elementary school to college. I have also helped students prepare for standardized tests such as the SAT and ACT. In addition to academic tutoring, I have also worked as a swim coach and a camp counselor, and have experience working with children with special needs.
0.00
0 Reviews
10+ Question Solved
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Question Posted:
Students also viewed these Computer science questions
-
The class TimeBook in Listing 7.14 is not really finished. Complete the definition of this class in the way described in the text. In particular, be sure to add a default constructor, as well as set...
-
In Chapter 7 you developed a use case diagram, a class diagram, and a system sequence diagram for the use cases Rent movies and Return movies. Based on those solutions or others provided by your...
-
Create a class named Majors that includes an enumeration for the six majors offered by a college as follows: ACC, CHEM, CIS, ENG, HIS, PHYS. Display the enumeration values for the user, and then...
-
Suppose the following game is repeated once (that is, played twice in total). Bridget SB (10, 74) SA Alex S'A SA SB (70,70) (74, 10) (-10,-10) (40,40) (-10,-10) SB (-10,-10) (-10,-10) (50, 50) (a)...
-
When we double the compression ratio of an ideal Otto cycle, what happens to the maximum gas temperature and pressure when the state of the air at the beginning of the compression and the amount of...
-
Based on Problem 2-9A, prepare a balance sheet for Jay Pembroke as of April 30, 20--.
-
\(\frac{13}{36}-\frac{14}{99}\) Perform the indicated operations. Reduce to lowest terms.
-
Bertha's Bathworks produces hair and bath products. Its biggest customer is a national retail chain that specializes in such products. Bertha Jackson, the owner of Bertha's Bathworks, would like to...
-
Whats the best say to remember debits and credits for each account in accounting? Also how does one memorize what is added and subtracted from Net Income in a Statement of Cash Flows?
-
1. What micro-environmental factors have affected Fitbit since it opened for business? 2. How should Fitbit overcome the threats and obstacles it faces? 3. What factors in the marketing environment...
-
Create a JavaFX application to create the interface for a calculator. Use a BorderPane in the stage with a TextField at the top. The text field would be used to store the number being entered in the...
-
Your application wont actually function as a calculator at this point. You are just designing the interface.
-
How fast would you have to travel to reach the Crab Nebula, 6500 light years from Earth, in 15 years? Give your answer to seven significant figures.
-
Q1: Consider a GaN (n=2.7) phototedetector. Find the ratio of the optical power that makes it into the GaN (from air, n=1) at an incidence angle of 37 degrees (measured from the normal). Do this...
-
A 3500-pFp Fair-gap capacitor is connected to a 30-V battery. If a piece of mica (K= 7) is placed between the plates, how much charge will flow from the battery? Express your answer using one...
-
Explain what is a "Balanced Scorecard" approach to performance management. Explain if this approach is suitable for designing a competency-based structure. Name four (4) key elements that were...
-
CAPITAL GAINS RESERVE EXAMPLE In 20x4 John sold a building having an ACB of 40,000 for 250,000. Disposal fees on this transaction were $10,000. The purchaser has agreed to pay for the building...
-
1. What is the work required to raise a 100 kilogram barbell 2 meters upwards? 2. What is the velocity of a 500 kg car that is pulled with 10000 N of force for a total distance of 30 meters? Assume...
-
Does hunger improve strategic decision making? That is, if you are hungry are you more likely to make a favorable decision when the outcome of your decision is uncertain (as in business decisions)?...
-
On October 31 Juanita Ortega, owner of Outback Guide Service, received a bank statement dated October 30. Juanita found the following: 1. The checkbook has a balance of $2,551.34. 2. The bank...
-
If the conditional at line 14 of our quickSortInPlace implementation of Code Fragment 12.6 were changed to use condition left < right, instead of condition left /** Sort the subarray S[a.b]...
-
If the outermost while loop of our implementation of quickSortInPlace (line 9 of Code Fragment 12.6) were changed to use condition left < right, instead of condition left /** Sort the subarray S[a.b]...
-
Suppose the method quickSortInPlace is executed on a sequence with duplicate elements. Prove that the algorithm still correctly sorts the input sequence. What happens in the partition step when there...
-
Jacarda Company makes a composting bin that is subject to wide seasonal variations in demand. Unit product costs are computed on a quarterly basis by dividing each quarter's manufacturing costs...
-
B Co. uses a job order costing system for client contracts. A customer recently ordered 30,000 units and the job was assigned Job777. Information for Job 777 revealed the following: Direct...
-
! Required information [The following information applies to the questions displayed below.] Hudson Company reports the following contribution margin income statement. HUDSON COMPANY Contribution...
Study smarter with the SolutionInn App