Question: 1 - - SmartArt Homework a) Create a class Employee with private attributes name(String), salary (double), and age (integer) b) Write a method setInfo of
1 - - SmartArt Homework a) Create a class Employee with private attributes name(String), salary (double), and age (integer) b) Write a method setInfo of the type void that takes 2 parameters: string n and double s where n will be assigned to the variable name and s to the variable salary. Age will be given a value of 0 c) Write a method setInfo of the type void that takes 3 parameters: string n, double s, and integer a where n will be assigned to the variable name, s to the variable salary, and a to the variable age d) Write a getter for each variable e) Declare object emp of class Employee and use setInfo with 2 variables f) Declare objects emp2 of class Employee and use setInfo with 3 variables g) Print the details of object emp and emp2 using getter methods
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
