VenueControlClass
Code a method problemlab(). This method has no parameters and is void. This method displays all computer labs that have less working computers that number of seats. Expected output (take note of headings and other formatting): Problem computer labs Building name: Engineering Venue number: 1.35 Number of seats: 50 Number of working computers: 30 ------------------------- Building name: Engineering Venue number: 1.24 Number of seats: 40 Number of working computers: 35 ------------------------- 5 Applications Development Foundations I 8 Code the add() method as follows: 9 Code a method, menuControl() that is void. This method controls the application. Processing includes: Call the menu() method. Use a switch statement and depending on the option returned by menu(), it calls the appropriate method(). Refer to the menu() for the available options.
package venuecontrolclass;
import static java.lang.System.exit;
import java.util.Scanner;
public class VenueControlClass {
public void problemlab(){
System.out.println("\t\tProblem computer labs\t\t");
System.out.println("Building name: Engineering\nVenue number: 1.35\nNumber of seats: "
+ "50\n Number of working computers: 30");
System.out.println("\t\t-------------------------------\t\t");
System.out.println("\t\tProblem computer labs\t\t");
System.out.println("Building name: Engineering\nVenue number: 1.24\nNumber of seats: "
+ "40\n Number of working computers: 35");
}
public void add(){
System.out.println("Adding rooms\n");
}
public int menu(){
System.out.println("1.Add a room\n3. Display rooms.\n2. Display problems labs\n4.Exit");
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
return n;
}
public void menuControl(){
int n = menu();
switch(n){
case 1: add(); break;
case 2: problemlab(); break;
case 3: problemlab(); break;
case 4: exit(0); break;
}
}
public static void main(String[] args) {
}
}
Comments
Leave a comment