IN JAVA
Ask the user for three employees. Store the data into three employee objects (use the Employee class from the previous question). Display those employees in a table. On this question, you'll submit two files: Employee.java and some other file that has a main.
| Standard Input |
|---|
Bill Gates 1234 Engineering Engineer Elon Musk 4443 Business CEO Steve Jobs 9999 Creative Designer |
Required Output
-- Employee Entry Form --\n
Enter name\n
Enter ID\n
Enter department\n
Enter position\n
-- Employee Entry Form --\n
Enter name\n
Enter ID\n
Enter department\n
Enter position\n
-- Employee Entry Form --\n
Enter name\n
Enter ID\n
Enter department\n
Enter position\n
Name ID Department Position\n
Bill Gates 1234 Engineering Engineer\n
Elon Musk 4443 Business CEO\n
Steve Jobs 9999 Creative Designer\n
Here's what I have for Employee.java so far
public class Employee
{
private String name;
private int idNumber;
private String department;
private String position;
public Employee(String name, int idNumber, String department, String position)
{
this.name = name;
this.idNumber = idNumber;
this.department = department;
this.position = position;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public int getIdNumber()
{
return idNumber;
}
public void setIdNumber(int idNumber)
{
this.idNumber = idNumber;
}
public String getDepartment()
{
return department;
}
public void setDepartment(String department)
{
this.department = department;
}
public String getPosition()
{
return position;
}
public void setPosition(String position)
{
this.position = position;
}
}you employee class is the same by using this class I have creating the main class in this way
code
import java.util.*;
//this sis Main class
public class MainClass{
public static void main(String args[])
{ //variable for storing data of
employee
String name;
int idNumber;
String department;
String position;
//object of Scanner class for taking input from
user
Scanner sc = new Scanner(System.in);
System.out.println("-- Employee
Entry Form --");
System.out.println("Enter
name");
name = sc.nextLine();
System.out.println("Enter
ID");
idNumber = Integer.parseInt(sc.nextLine());
System.out.println("Enter
department");
department =
sc.nextLine();
System.out.println("Enter
position");
position = sc.nextLine();
//1st employee object
Employee obj1 =
new Employee(name, idNumber, department, position);
System.out.println("-- Employee Entry Form --");
System.out.println("Enter
name");
name = sc.nextLine();
System.out.println("Enter
ID");
idNumber = Integer.parseInt(sc.nextLine());
System.out.println("Enter
department");
department =
sc.nextLine();
System.out.println("Enter
position");
position = sc.nextLine();
//2nd employee object
Employee obj2 =
new Employee(name, idNumber, department, position);
System.out.println("-- Employee Entry Form --");
System.out.println("Enter
name");
name = sc.nextLine();
System.out.println("Enter
ID");
idNumber = Integer.parseInt(sc.nextLine());
System.out.println("Enter
department");
department =
sc.nextLine();
System.out.println("Enter
position");
position = sc.nextLine();
//3rd employee object
Employee obj3 =
new Employee(name, idNumber, department, position);
//code for
accessing the data from employee
System.out.println("Name
ID Department
Position");
System.out.println(obj1.getName() + " "+
obj1.getIdNumber() + "
"+obj1.getDepartment() +"
"+obj1.getPosition());
System.out.println(obj2.getName() + " "+
obj2.getIdNumber() + "
"+obj2.getDepartment() +"
"+obj2.getPosition());
System.out.println(obj3.getName() + " "+
obj3.getIdNumber() + "
"+obj3.getDepartment() +"
"+obj3.getPosition());
}
}
Screenshot of Code and Output


IN JAVA Ask the user for three employees. Store the data into three employee objects (use...
JAVA: How do I output all the data included for each employee? I can only get it to output the name, monthly salary and annual salary, but only from the Employee.java file, not Salesman.java or Executive.java. Employee.java package project1; public class Employee { private String name; private int monthlySalary; public Employee(String name, int monthlySalary) { this.name = name; this.monthlySalary = monthlySalary; } public int getAnnualSalary() { int totalPay = 0; totalPay = 12 * monthlySalary; return totalPay; } public String...
Java
Do 72a, 72b, 72c, 72d. Code & output required.
public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
Write a program in Java that prompts a user for Name and id number. and then the program outputs students GPA MAIN import java.util.StringTokenizer; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { String thedata = JOptionPane.showInputDialog(null, "Please type in Student Name. ", "Student OOP Program", JOptionPane.INFORMATION_MESSAGE); String name = thedata; Student pupil = new Student(name); //add code here ...
Java
Do 68a, 68b, 68c, 68d. Show code & output.
public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
Java Programming
Answer 60a, 60b, 60c, 60d. Show code & output.
public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return...
1) Introduction to Objects (with Constructors and Properties) We need to answer the question which are below. and instruction are given down starting with part(b). Just we need to copy paste code file and follow the instruction and answer related to them. a) Enter the following program.Answer The questions below the codes, Notice that it consists of two classes that will go into the same project. Please put each class into its own code file (use Lab5_1 for the Project...
It must be C++
Chapter 13 Programming Challenge 2: Employee Class.
See instruction: Chapter 13 Programming Challenge 2 Employee
Class.pdf
Program Template:
// Chapter 13, Programming Challenge 2: Employee Class
#include <iostream>
#include <string>
using namespace std;
// Employee Class Declaration
class Employee
{
private:
string name; // Employee's name
int idNumber; // ID number
string department; // Department name
string position; // Employee's position
public:
// TODO: Constructors
// TODO: Accessors
// TODO: Mutators
};
// Constructor #1
Employee::Employee(string...
Java
Do 61a, 61b, 61c, 61d. Show Output and Code.
public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...
I need code in java
The Student class:
CODE IN JAVA:
Student.java file:
public class Student {
private String name;
private double gpa;
private int idNumber;
public Student() {
this.name = "";
this.gpa = 0;
this.idNumber = 0;
}
public Student(String name, double gpa, int
idNumber) {
this.name = name;
this.gpa = gpa;
this.idNumber = idNumber;
}
public Student(Student s)...
I need help converting the following two classes into one sql table package Practice.model; import java.util.ArrayList; import java.util.List; import Practice.model.Comment; public class Students { private Integer id; private String name; private String specialties; private String presentation; List<Comment> comment; public Students() {} public Students(Integer id,String name, String specialties, String presentation) { this.id= id; this.name = name; this.specialties = specialties; this.presentation = presentation; this.comment = new ArrayList<Commment>(); } public Students(Integer id,String name, String specialties, String presentation, List<Comment> comment) { this.id= id; this.name...