2. Write a general program that creates a class called Worker that has 3 pieces of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Write a general program that creates a class called Worker that has 3 pieces of information as data members. These data members are a name, a surname, and a monthly salary. Include a constructor to initialize the 3 data members. You are expected to have get and set functions for every data member. Negative valued monthly salary should be set to zero. To test the software, write a test program that shows all the capabilities of employee class. Create 2 Worker objects and show each object's yearly earning. Then give every Worker a %10 raise and show each Workers yearly earning again. 2. Write a general program that creates a class called Worker that has 3 pieces of information as data members. These data members are a name, a surname, and a monthly salary. Include a constructor to initialize the 3 data members. You are expected to have get and set functions for every data member. Negative valued monthly salary should be set to zero. To test the software, write a test program that shows all the capabilities of employee class. Create 2 Worker objects and show each object's yearly earning. Then give every Worker a %10 raise and show each Workers yearly earning again.
Expert Answer:
Related Book For
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Debug the given C program to read and print N array elements. Find 10 errors in the given Code and correct the errors. (5Marks) NOTE: Copy and PASTE the correct program in the space below. /*Arrays...
-
Gilman and colleagues (2008) measured general life satisfaction in 1,338 adolescents from two individualistic nations (Ireland, United States) and two collectivist nations (China, South Korea) using...
-
Recall at the beginning of the chapter we gave a linear program to help a web server company decide what server models it should purchase. Suppose that the standard server model has been replaced by...
-
A trapezoidal channel with a bottom width of \(3.0 \mathrm{~m}\) and sides with a slope of 2:1 (horizontal:vertical) is lined with fine gravel \((n=0.020)\) and is to carry \(10 \mathrm{~m}^{3} /...
-
Raider-X Company forecasts sales of 18,000 units for April. Beginning inventory is 3,000 units. The desired ending inventory is 30% higher than the beginning inventory. How many units should Raider-X...
-
What are the three most important laws that regulate discrimination in employment? Who is protected by each, and what rights do employers still maintain when it comes to making decisions about...
-
A is the owner of a life insurance policy on the life of B. A transfers ownership of the policy to B. A dies two years later. What estate tax consequences may A face as a result?
-
Krieger Krisp Donuts, Inc. acquired 40% of the voting common shares of Delevan Bakers Corporation on January 1, 2022, at a total cost of $2,535,000. At acquisition, the reported book value of Delevan...
-
Ashby plot for materials index of (E2/p), suitable for a Beam of minimum weight and prescribed stiffness. On the Log E versus Log p graph, slide the materials index line of slope 2 upwards to...
-
Design a typical interior floor beam B1 of a two-storeyed school building plan shown in Figure 1. Also draw beam elevation and section with reinforcement details. You can make reasonable assumptions...
-
Please be sure not to copy any answers verbatim. original answers needed will be scanned through the safe-assign system. please review detailed answer the following questions below in regards to the...
-
Dart Industries Room Sales Worksheet Rooms sold Room rate Total revenue Variable cost per Total variable After variable costs revenue room costs 50 $ 149.99 $ 7,499.50 $ 250 $ 139.99 350 $ 139.99 401...
-
Let R be the region in the first quadrant bounded by the graphs of y = x and y -axis is a square. What is the volume of the solid? 4x, as shown in the figure above. The region R is the base of a...
-
The following cost information was provided to you for analysis: September 12,000 Units Produced Costs: TIC TAC TOE TING August 10,000 P80,000 70.000 60.000 50,000 How much is the fixed cost per...
-
In this chapter, you studied an inheritance hierarchy in which classBasePlusCommissionEmployee inherited from class CommissionEmployee. However, not all types of employees are CommissionEmployees. In...
-
Lets create a computer called the Simpletron. As its name implies, its a simple machine, but powerful. The Simpletron runs programs written in the only language it directly understands: Simpletron...
-
Write an application that calculates the average of a series of integers that are passed to method average using a variable-length argument list. Test your method with several calls, each with a...
-
For a company with no preference shares, earnings is the: A. Sales figure. B. Profit before tax. C. Profit after tax. D. Profit after tax and after dividends.
-
Repeat Exercise 1.4 from Chapter 1. Do you think that users know what to ask for from their accountant or financial adviser? Data from Repeat Exercise 1.4 Do you think that users know what to ask for...
-
Bakshi Ltd has a current ratio of 2.0 and an acid test ratio of 1.0. If some current liabilities are paid off using cash, what would be the effect on these ratios? Current ratio Acid test ratio A....
Study smarter with the SolutionInn App