MIDTERM PRACTICAL EXAM Based on the following output, construct the codes using all possible structures. Welcome to MIDTERM Practical Exam, please choose a lesson to start an exercise: A. Basic Display of Hello World B. Using Arithmetic Operation C. Using Decision Control Structures D. Using Single Array E. Using Stack and Queue F. Exit the program Enter your choice here => //A. Basic Display of Hello World This is the basic structure of displaying a String: public class hello{ public static void main (String [] args) { System.out.println(“Hello World”); }} Do you want to try again? [Y] to return to Basic Display of Hello World menu and [N] to return to the Main Menu. => //B. Using Arithmetic Operation Enter two integers: a. Sum => b. Difference => c. Product => d. Quotient => Do you want to try again? [Y] to return to Using Arithmetic Operation menu and [N] to return to the Main Menu. => //C. Using Decision Control Structures Determine an Integer whether it is ODD or EVEN A. IF Statement B. IF ELSE Statement C. IF ELSE IF Statement Enter your choice here = > Enter an Integer => The integer is an <EVEN> number. Do you want to try again? [Y] to return to Using Decision Control Structures menu and [N] to return to the Main Menu. => //D. Using Single Array Enter the Start Number: <snum> Enter the Last Number: < lnum> Enter First name: Enter Last name Display Result: _ <snum> _ “ “ “ “ _ _ /*Note: Start Number either larger or smaller than the Last Number: */ Do you want to try again? [Y] to return to Using Single Array menu and [N] to return to the Main Menu. =>
//E. Using Stack and Queue Choose a Method Stack Queue Enter your choice here = > //Stack You choose Stack Method! Enter five Names: Stack = > Stack.peek() => Stack.size() = > Stack.pop() => Stack => Is Stack Empty = > Do you want to try again? [Y] to return to Using Stack and Queue menu and [N] to return to the Main Menu. => //Queue You choose Queue Method! Enter five Names: Queue = > Queue.peek() => Queue.size() = > Queue.remove() => Queue => Is Queue Empty = > Do you want to try again? [Y] to return to Using Stack and Queue menu and [N] to return to the Main Menu. =>
---------------------------------------------------------------------------------------------------------------------------------------------------------------BONUS POINTS: -
Error Message is available