Question: Please help import javax.swing.JOptionPane; import java.util.Scanner; public class test _ place { public static void main ( String [ ] args ) { / /
Please help
import javax.swing.JOptionPane;
import java.util.Scanner;
public class testplace
public static void mainString args
Get user input for starting floor, total floors, and rooms per floor
int firstInputFloor, userTotalFloor, numberOfRoomPerFloor;
firstInputFloor getIntegerInputEnter starting floor number between and : ;
userTotalFloor getIntegerInputEnter total number of floors between and : ;
numberOfRoomPerFloor getIntegerInputEnter number of rooms per floor between and : ;
Validaeeeet e room numbering based on number of rooms and floors
int maxRoomNumberDigits userTotalFloor : userTotalFloor && firstInputFloor : ;
if StringvalueOfuserTotalFloorlength maxRoomNumberDigits
Above is what i have so far
DO NOT use arrays, methods, or functions for this assignment.
The only import allowed is: import javax.swing.JOptionPane;
Make sure to follow the specified format and requirements closely.Use only concepts covered in class, such as nested for loops and conditional statements.
DO NOT use arrays, methods, or functions for this assignment.
The only import allowed is: import javax.swing.JOptionPane;
Make sure to followA hotel room cleaning roster is like a schedule for housekeeping staff, detailing when and how each hotel room will be cleaned. This plan ensures that all rooms receive regular cleaning, maintaining a pleasant and hygienic experience for guests. To create your own hotel room cleaning roster, you can use nested loops in Java.
Nested loops in Java involve placing one loop inside another, providing a structured approach for repetitive tasks, especially when dealing with complex data or patterns. Essentially, there's an outer loop that encloses an inner loop. The inner loop completes its iterations for each run of the outer loop, helping you organize and execute cleaning tasks efficiently.
JOptionPane is a Java class in the javax.swing package. It simplifies the creation of dialog boxes for user interaction. JOptionPane provides static methods to display input prompts, messages, and confirmations, making it easy to integrate user interaction into Java applications.
contentdivider.png
The learning goals for this assignment are to:
Understand and implement nested loops for loops in Java.
Practice using conditional statements to format room numbers.
Create a simple textbased room roster for custodians.
checklist.pngAssignment Checklist HotelRoomEx:
Setting Up:
Open Visual Studio Code VSC and create a new file with the class named HotelRoomEx
Add a comment block at the top, including your name, UIN, section, and date
Java Code:
Write Java code with correct indention and formatting.
Utilize JOptionPane.showInputDialog to prompt the user for starting floor, total number of floors, and total number of rooms per floor.
Use JOptionPane.showMessageDialog to show a message if the user enters an invalid input, guiding them to enter a different number.
Skip the th floor due to superstitions.
Utilize nested loops to create the hotel room cleaning roster.
Roster Display:
Ensure the roster has the title "Hotel Room Cleaning Roster" and features two columns: "Room Number" and "Cleaned".
Display each room entry as "roomnumber with underscores for checkmarks. Utilize the tab character for alignment.
Insert a blank lines between entries for each floor.
Output the roster to the terminalpowershell
Your program should generate the roster in the following format: hotel.png
Floor Requirements:
Confirm that the starting floor falls between and
if not, output to the screen
"Starting floor must be between and and exit.
Validate the top floor does not exceed
if not, output to the screen
"Top floor must be between and and exit.
Guarantee the same number of rooms per floor.
Room Numbering:
For floors with fewer than rooms, use a digit room number eg For floors and above, use a digit number eg
If there are or more rooms per floor, use a digit room number eg or digits for floors and above.
if there are no rooms or more than digits of rooms per floor output to the screen
"Rooms per floor should be between and and exit.
Comments:
Comment different sections of code for clarity.
File Management:
Save the Java code in a file named HotelRoomExjava
Compilation and Evaluation:
Compile your code using the javac command
Evaluate the results using the java command.
Ensure the code compiles without errors. The code must compile without errors to receive any credit.
Iteration:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
