Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Create an object with private attributes(variables). EmpID Hours Rate Wages Then create an array of objects using the array class. Write the appropriate accessors, mutators

Create an object with private attributes(variables).

  1. EmpID
  2. Hours
  3. Rate
  4. Wages

Then create an array of objects using the array class. Write the appropriate accessors, mutators and constructors to calculate wages and display the data. Include a UML diagram.

I have my code below but everytime I run it, it gives me the message " The constructor Wages(int, double, double) is undefined." How do I fix this problem? I have attached some pictures of my code below.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

File Edit Selection View Go Debug Terminal Help Wages.java Visual Studio Code - X 0 D RUN AND DEBUG START 47 Wages.java X WagesObjectArray.java C> Users > ivysm > OneDrive > Desktop > Java > i public class Wages Wages.java > Wages > Wages(int, int, double) Run and Debug Java (F5) a Po o o o os To customize Run and Debug, open a folder and create a launch.json file. private int EmpID; private int Hours; private double Rate; private double Wages; public wages(int EmpID, int Hours, double Rate) this. EmpID = EmpID; this.Hours = Hours; this.Rate = Rate; this.Wages = Hours * Rate; public void printPayroll() DecimalFormal df = new DecimalFormat("##.00"); System.out.println(EmpID+""+"$"+df.format(Wages)) public int getEmpIDO return EmpID; public void setEmpID(int EmpID) this.EmpID = EmpID; public int getHours) return Hours; A0 Ln 8. Col 32 Spaces: 4 UTF-8 Java O Type here to search | 0 = = e t = 0 Users > ivysm > OneDrive > Desktop > Java > public int getHours() Wages.java > Wages > Wages(int, int, double) Run and Debug Java (F5) return Hours; a Po o o o os public void setHours(int Hours) To customize Run and Debug, open a folder and create a launch.json file. this.Hours = Hours; public double getRate() return Rate; public void setRate (double Rate) this.Rate = Rate; public double getWages() return Wages; public void setWages (double Wages) this.Wages = Wages; Screenshot saved The screenshot was added to your OneDrive. OneDrive A0 LMS, CISZ Spaces UI Type here to search Et e 7 CRLF O = Jav U V 4:34 PM 2/18/20201 File Edit Selection View Go Debug Terminal Help WagesObjectArray.java Visual Studio Code - X RUN AND DEBUG START 420 Wages.java WagesObjectArray.java X C> Users > ivysm > OneDrive > Desktop > Java > i import java.util.Scanner; import java.text.DecimalFormat; WagesObjectArray.java > WagesObjectArray > main(String[]) Run and Debug Java a Po o o o os 4 public class WagesObjectArray To customize Run and Debug, open a folder and create a launch.json file. Run Debug public static void main(String[] args) int numEmp, EmpID; double Hours; double Rate; Scanner keyboard = new Scanner(System.in); System.out.println("How many employees are there? numEmp = keyboard.nextInt(); keyboard.nextLine(); Wages[] empList = new Wages [numEmp]; for (int i = 0; i Users > ivysm > OneDrive > Desktop > Java > WagesObjectArray.java > Wages[] empList = new Wages[numEmp]; for (int i = @; i main(String[]) Run and Debug Java a Po o o o os To customize Run and Debug, open a folder and create a launch.json file. System.out.println("Enter employee ID: "); EmpID = keyboard.nextInt(); System.out.println("Enter the number of hours worked: "); Hours = keyboard.nextInt(); System.out.println("Enter the hourly rate: "); Rate = keyboard.nextDouble(); keyboard.nextLine(); Wages employee = new Wages (EmpID, Hours, Rate); empList[i] = employee; System.out.println("\t\tEmployee Payroll Calculator\t\t"); System.out.println("\tEmpID\t\twages"); System.out.println("---- for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Explain the idea of sustainable development

Answered: 1 week ago