public Venue createVenue() {
// a) Define a Scanner variable to read from the keyboard.
Scanner keyboard = new Scanner(System.in);
// b) Define variables for building name, room number and number of seats.
// Prompt the user to type data values for each of the variables and and read
// the values from the keyboard.
System.out.print("Enter a building name: ");
String buildingName = keyboard.nextLine();
System.out.print("Enter a room number: ");
String roomNumber = keyboard.nextLine();
System.out.print("Enter a number of seats: ");
int numberSeats = keyboard.nextInt();
// c) Define and create a Venue object from the data read from the keyboard.
Venue venue = new Venue(buildingName, roomNumber, numberSeats);
// d) Return this Venue object
keyboard.close();
return venue;
}
Comments
Leave a comment