1. Write a Java program to find power of a number using recursion, ex: 2^3 =...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a Java program to find power of a number using recursion, ex: 2^3 = 8. (3 marks) 2. Array of objects: (7 marks) a. Write a java program to implement an employee class. The class has three fields name,salary, and years of experience. b. Create a constructor that accepts 3 paratemeters (name, salary, and years of experience). c. Write 3 accessor methods to return the values of all fileds above. d. Write 3 setter methods to change the value of all fileds above. e. Write ConditionalChangeSalary() that checks the years of experience of the employee object. If the years of experience >10, then the salary of employee is increased by 2000 SR, otherwise no change occurs. f. Finally, build toString() method to return string representation of all the fileds. g. Create a main method that creates one object of employee class and call the methods you built previously on this object. h. Create array of employee objects. i. Use for loop to Create 3 employee objects (stored in the array) & initialize employee objects using constructor. j. Use for loop to set the values of all fields of the three employee objects using the setter methods you built previousely. k. Use for loop to increase the salary of three employee objects based on the ConditionalChangeSalary() method created above. I. ALSO, use for loop to print the values of objects' fileds using the toString() method built previously. 1. Write a Java program to find power of a number using recursion, ex: 2^3 = 8. (3 marks) 2. Array of objects: (7 marks) a. Write a java program to implement an employee class. The class has three fields name,salary, and years of experience. b. Create a constructor that accepts 3 paratemeters (name, salary, and years of experience). c. Write 3 accessor methods to return the values of all fileds above. d. Write 3 setter methods to change the value of all fileds above. e. Write ConditionalChangeSalary() that checks the years of experience of the employee object. If the years of experience >10, then the salary of employee is increased by 2000 SR, otherwise no change occurs. f. Finally, build toString() method to return string representation of all the fileds. g. Create a main method that creates one object of employee class and call the methods you built previously on this object. h. Create array of employee objects. i. Use for loop to Create 3 employee objects (stored in the array) & initialize employee objects using constructor. j. Use for loop to set the values of all fields of the three employee objects using the setter methods you built previousely. k. Use for loop to increase the salary of three employee objects based on the ConditionalChangeSalary() method created above. I. ALSO, use for loop to print the values of objects' fileds using the toString() method built previously.
Expert Answer:
Answer rating: 100% (QA)
Here is a Java program that fulfills your requirements class Employee private String name private do... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Suppose the Malaysia has 1,000 labor hours available. Construct the production- possibilities frontier (PPF) and identify the optimal autarky equilibrium (using an indifference curve) for Malaysia.
-
Why take the time for team members to learn about each others personal lives? What are the responsibilities of the team leader, and what are the most desirable skills and behaviors? What is the value...
-
How do sociologists delineate social class and its intricate manifestations within contemporary societies?
-
Find a basis for the subspace Wspanned by {v1, v2 , V3, V4}. 2 Let vi = -3,v2 = 2 ,v3 -2,v4 = 3
-
Elevator shafts in some buildings extend not only above ground, but in many cases below ground to accommodate basements, underground parking, etc. The bar graph shows four such elevators and their...
-
At December 31, 2015, Torrealba Company reported the following as plant assets. During 2016, the following selected cash transactions occurred. April 1 Purchased land for $1,200,000. May 1 Sold...
-
What does it mean to say that gender is culturally constructed?
-
Whitehouse Company manufactures major appliances. Because of growing interest in its products, it has just had its most successful year. In preparing the budget for next year, its controller compiled...
-
Determine the highest real root of f(x) = -3x - 4x + 12 2 a) by graphing it in MATLAB (sketch your plot and give an approximate value) b) using 3 iterations (by hand) of Newton-Raphson. Make a table...
-
Wu Manufacturing produces two keyboards, one for laptop computers and the other for desktop computers. The production process is automated, and the company has found activity-based costing useful in...
-
Squid Corporation, a 90%-owned subsidiary of Penguin Corporation, sold inventory items to its parent at a $24,000 profit in 2005. Penguin resold one-third of this inventory to outside entities. Squid...
-
Explain the VEC model.
-
Explain why estimation of a supply and demand model requires an alternative to ordinary least squares (OLS).
-
Explain the term "conditionally normal."
-
Discuss the implications of censored data for least squares estimation.
-
Explain the relationship between a VEC model and a VAR model.
-
How do politics affect stocks of multinational energy companies? For example, the Cheveron Corporation is multinational energy company that is engaged in all aspects of oil and natural gas...
-
Explain briefly what is meant by electronic data interchange (EDI). How does EDI affect a companys audit trail?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-7. Ivan sold the following securities during the year and received a Form 1099-B that...
-
Diego, age 28, married Dolores, age 27, in 2012. Their salaries for the year amounted to $46,479 and they had interest income of $3,500. Diego and Dolores' deductions for adjusted gross income...
-
Bill and Guilda each own 50 percent of the stock of Radiata Corporation, an S corporation. Guilda's basis in her stock is $25,000. On July 31, 2012, Bill sells his stock, with a basis of $40,000, to...
-
Trust Management System: A university would like to develop a system for students to evaluate their peers performance in some group projects. Students ratings in various categories will affect a...
-
Building trust in potential students to join music classes by a music teacher a. Explain the above scenario. b. Draw a class diagram for it. c. Document a detailed and significant use case. d. Create...
-
Building trust in parents by hostel authorities to state that hostel is safe for students to live a. Explain the above scenario. b. Draw a class diagram for it. c. Document a detailed and significant...
Study smarter with the SolutionInn App