Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need a Java progam using aggregations Using Shoes as the program. example: pro

ID: 3758500 • Letter: I

Question

I need a Java progam using aggregations Using Shoes as the program.

example: program should incloude

A SHOES CLASS,SIZE CLASS,BRANDS CLASS, COLOR CLASS AND THE SHOESDEMO that is going to call out the classes.

On the demo please do not hard codind and every class needs to have a method

**Please dont use the joptionpane in java**

This is a exmple program

public class ShiftSupervisorDemo {

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

ShiftSupervisor ss=new ShiftSupervisor("John Smith","123-A"," 11-15-2005", 48000, 6500);

System.out.println("Here's the first shift supervisor.");

System.out.println(ss);

ShiftSupervisor ss2 =new ShiftSupervisor();

ss2.setName("Joan Jones");

ss2.setEmployeeNumber("222-L");

ss2.setHireDate( "12-12-2005");

ss2.setSalary(55000);

ss2.setEmployeeNumber("8000");

System.out.println("Here's the Second shift supervisor.");

System.out.println(ss2);

}

}

public class Employee

{

private String name; // Employee name

private String employeeNumber; // Employee number

private String hireDate; // Employee hire date

//This constructor initializes an object with a name, employee number, and hire date.

public Employee(String n, String num, String date)

{

name = n;

setEmployeeNumber(num);

hireDate = date;

}

//The no-arg constructor initializes an object with null strings for name, employee number, and hire date.

public Employee()

{

name = "";

employeeNumber = "";

hireDate = "";

}

//The setName method sets the employee's name.

public void setName(String n)

{

name = n;

}

//The setEmployeeNumber method sets the employee's number.

public void setEmployeeNumber(String e)

{

if (isValidEmpNum(e))

employeeNumber = e;

else

employeeNumber = "";

}

//The setHireDate method sets the employee's hire date.

public void setHireDate(String h)

{

hireDate = h;

}

//The getName method returns the employee's name.

public String getName()

{

return name;

}

//The getEmployeeNumber method returns the employee's number.

public String getEmployeeNumber()

{

return employeeNumber;

}

//The getHireDate method returns the employee's hire date.

public String getHireDate()

{

return hireDate;

}

//isValidEmpNum is a private method that determines whether a string is a valid employee number.

private boolean isValidEmpNum(String e)

{

boolean status = true;

if (e.length() != 5)

status = false;

else

{

if ((!Character.isDigit(e.charAt(0))) ||

(!Character.isDigit(e.charAt(1))) ||

(!Character.isDigit(e.charAt(2))) ||

(e.charAt(3) != '-') ||

(!Character.isLetter(e.charAt(4))))

status = false;

}

return status;

}

//toString method @return A reference to a String representation of the object.

public String toString()

{

String str = "Name: " + name + " Employee Number: ";

if (employeeNumber == "")

str += "INVALID EMPLOYEE NUMBER";

else

str += employeeNumber;

str += (" Hire Date: " + hireDate);

return str;

}

}

import java.text.DecimalFormat;

public class ShiftSupervisor extends Employee

// TODO Auto-generated method stub

{

private double salary;

private double bonus;

public ShiftSupervisor(String n,String num,String date,double sal, double b){

super();

salary= sal;

bonus= b ;

}

public ShiftSupervisor()

{

super();

salary= 0.0;

bonus= 0.0 ;

}

public void setSalary(double s)

{

salary = s;

}

public void setBonus(double b)

{

bonus=b;

}

public double getSalary()

{

return salary;

}

public double getBonus()

{

return bonus;

}

public String toString()

{

DecimalFormat dollar= new DecimalFormat("#,##0.00");

String str=super.toString();

str+=(" Annual Salary: $" + dollar.format(salary));

str+=(" Production Bonus: $" + dollar.format(bonus));

return str;

}

}

Thank you i will rate!!!

Explanation / Answer

public class Brand{
   private String brandName;
   private String country;
   public Brand(){
       brandName = "";
       country = "";
   }
   public Brand(string brandName,string country){
       this.brandName = brandName;
       this.country = country;
   }
   String getBrand(){
       return brandName;
   }
   String getCountry(){
       return country;
   }
   void setBrand(String brand){
       brandName = brand;
   }
   void setCountry(String country){
       this.country = country;
   }
}

public class Color{
   private String ColorName;
   private String colorCode;
   public Color(){
       ColorName = "";
       colorCode = "";
   }
   public Color(string ColorName,string colorCode){
       this.ColorName = ColorName;
       this.colorCode = colorCode;
   }
   String getColor(){
       return ColorName;
   }
   String getcolorCode(){
       return colorCode;
   }
   void setColor(String Color){
       ColorName = Color;
   }  
}

public class Size{
   private int sizeNumber;
   private String sizeCode;
   public Color(){
       sizeNumber = "";
       sizeCode = "";
   }
   public Color(int sizeNumber,string sizeCode){
       this.sizeNumber = sizeNumber;
       this.sizeCode = sizeCode;
   }
   int getSize(){
       return sizeNumber;
   }
   String getsizeCode(){
       return sizeCode;
   }
   void setSize(String Color){
       sizeNumber = Color;
   }  
}
public class Shoes{
   Size size;
   Brand brand;
   Color color;
   //Initialize everything now
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote