Question: . Introauction to Java Technologies home > 7 . 3 : Defining a class zyBooks cata Jump to level 1 In the Business class, declare

. Introauction to Java Technologies home >7.3: Defining a class
zyBooks cata
Jump to level 1
In the Business class, declare the following private fields:
integer yearsOpen
integer numStock
integer numEmployees
and define the following public methods:
getYearsOpen() has no parameters and returns the yearsOpen field.
getNumStock() has no parameters and returns the numStock field.
getNumEmployees() has no parameters and returns the numEmployees field.
Ex: If the input is 2629611, then the output is:
Years open: 26
Items in stock: 296
Number of employees: 11
Note: If a field is not properly declared as private, an error message will be output.
BusinessInfo.java
public class Business {
Y* Your code goes here */
public void setYearsopen(int customYearsopen){
}
yearsOpen = customYearsOpen;
public void setNumStock(int customNumStock){
}
numstock = customNumStock;
public void setNumEmployees (int customNumEmployees){
}
numEmployees = customNumEmployees;
}
 . Introauction to Java Technologies home >7.3: Defining a class zyBooks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!