59.7k views
3 votes
Mason registrar office is keeping track of lab classrooms across different buildings in the Fairfax campus. Nguyen Engineering Building has 15 lab classrooms. Each room has a number, capacity and a number of computers. The labroom number should be 3 characters long where the first character is 'E' and the remaining two are digits. The capacity of each classroom must be atleast 10. Given the scenario above, write a partial Data definition class LabRoom with all the instance variables

User Zach L
by
7.6k points

1 Answer

5 votes

Final answer:

The Data definition class LabRoom would consist of a String roomNumber with a specific format, an integer capacity with a minimum value of 10, and an integer number of computers to track the count of computers in each lab classroom.

Step-by-step explanation:

To meet the requirements outlined by the Mason registrar's office for tracking lab classrooms in the Nguyen Engineering Building on the Fairfax campus, we can define a partial Data definition class LabRoom with the appropriate instance variables. Here is how the LabRoom class can be structured:


public class LabRoom {
private String roomNumber; // 3 characters long, starts with 'E', followed by 2 digits
private int capacity; // Minimum capacity of 10
private int number of computers;

// Constructor, getters, setters, and any additional methods will go here
}

The roomNumber variable should adhere to the specified format. The capacity variable must be an integer with a value that is not less than 10. The number of computers variable will hold the number of computers available in each lab classroom.

User Jonathan Stray
by
7.9k points