Solved

CLASS Employee { //Variables

Question 1

Multiple Choice

CLASS Employee {
//Variables
String LastName;
String FirstName;
Real HourlyRate;
Integer HoursWorked;
Date HireDate;
String Job;
//Methods
Real Salary() ;
String GetLastName() ;
String GetFirstName() ;
String GetJob() ;}

-The ability by a program do to the following violates encapsulation principles:


A) Directly Access LastName
B) Retrieve LastName with method GetLastName() ;
C) Retrieve Job with the method GetJob() ;
D) Compute salary with method Salary()

Correct Answer:

verifed

Verified

Related Questions