Professional Documents
Culture Documents
Midterm Period
Selection Control Structure
Submission Requirement
1. Document the exercise by taking a screenshot of the program output.
2. Zip the following files. Name the folder LastnameFirstnameModule3Exercise3_4.
Java Files (.java)
Exercise Documentation
Directions:
Answer:
AUTHOR
package module3_exercise3_4.selectioncontrolstructure;
import java.io.*;
authorId = authId;
lastName = authLastName;
firstName = authFirstName;
}
BORROWER
package module3_exercise3_4.selectioncontrolstructure;
import javax.swing.JOptionPane;
return BorrowerId;
return LastName;
return FirstName;
Borrower.BorrowerId = BorrowerId;
Borrower.LastName = LastName;
Borrower.FirstName = FirstName;
BOOK
package module3_exercise3_4.selectioncontrolstructure;
import java.io.*;
import java.util.Scanner;
import javax.swing.JOptionPane;
public Book (int bookId, String title, String ISBN, String category){
Book.bookId = bookId;
Book.title = title;
Book.ISBN = ISBN;
Book.category = category;
}
}
CATALOGUE
package module3_exercise3_4.selectioncontrolstructure;
import javax.swing.JOptionPane;
int step = 1;
while (another) {
switch (step) {
case 1:
step++;
case 2:
step++;
case 3:
step++;
if (step == 4) {
do {
if (anotherq.equalsIgnoreCase("y")) {
step = 1;
else if (anotherq.equalsIgnoreCase("n")) {
another = false;
else {
invalid = true;
while (invalid);
OOUTPUT