Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

I want to solve this question using a scanner without using arrays plss using Scanner 1- Create a java program to do the following: Employee

I want to solve this question using a scanner without using arrays image text in transcribed
plss using Scanner 1- Create a java program to do the following: Employee class - Attributes: id, name, department, age, and salary. - Default constructor (no parameters, no body) - Constructor with 5 parameters (id, name, department, age, and salary) - Constructor with 3 parameters (id, name, and age). Make the department fixed for all employees: Computer Science, and salary fixed to 7000 SR. - Sgetter methods (for every attribute) - 5 setter methods (for every attribute) - toString0 method to return string representation of all the attributes above. 1- In the main method (driver method): - Create an array named Employees - Create three employee objects using the constructor with 5 parameters created above. - Add the three employee objects in the array employees using for loop. - Print the details of all employees objects using toStringi) and getter methods also, using for loop. - Use for loop to Increment the salary of employee objects after checking the following condition: If the employee department is Computer science, increase his/her salary by 1000 Sr; otherwise no increase in salary will occur. (use the setter method for this purpose)

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