
i have created this java program but need help by making it the userHours limited to only 0 to 720 for all packages. If any number higher than 720, get this display
Invalid input, please enter number of hours between 0 & 720.
Let’s try again.
Enter the customer's package (A, B, or C): A
and allows you to choose a different package from the given.
Java Program:
import java.util.*;
class PackageFee {
public static void main(String[] args) {
Scanner sc = new
Scanner(System.in);
final double PACKAGE_A_BASE_PRICE =
9.95;
final double PACKAGE_B_BASE_PRICE =
12.95;
final double PACKAGE_C_BASE_PRICE =
19.95;
final int PACKAGE_A_LIMIT_HOURS =
10;
final int PACKAGE_B_LIMIT_HOURS =
20;
final double PACKAGE_A_EXTRA_FEE =
2;
final double PACKAGE_B_EXTRA_FEE =
1;
int userHours;
int hoursExceeded = 0;
double extraCharge = 0;
double totalBill=0;
String userPackage;
//Loop till user enters
correct value
do {
//Reading
customer package
System.out.println("Enter the customer's package: ");
userPackage =
sc.nextLine();
//Reading number
of hours used
System.out.println("Enter the number of hours used: ");
userHours =
sc.nextInt();
//Validating
number of hours used
if(userHours
< 0 || userHours > 720)
{
//Printing error message
System.out.println("Invalid input, please enter
number of hours between 0 & 720.\nLet's try
again.\n");
}
//Ignoring new
line
sc.nextLine();
}while(userHours < 0 ||
userHours > 720);
/* Remaining code here */
}
}
____________________________________________________________________________________________
Sample Run:

i have created this java program but need help by making it the userHours limited to...
In Java, I have created a program which can generate passwords. Currently the program can generate a password through a menu system of which characters to use. To complete the project, I need a system which allows the user to generate another password after the first password is created. I also need a method to check whether or not the password is complex by checking if the generated password has 3 or more character types and then displaying whether or...
Can you please help me to run this Java program? I have no idea why it is not running. import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DecimalFormat; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; @SuppressWarnings({"unchecked", "rawtypes"}) public class SmartPhonePackages extends JFrame { private static final long serialVersionID= 6548829860028144965L; private static final int windowWidth = 400; private static final int windowHeight = 200; private static final double SalesTax = 1.06; private static JPanel panel;...
I have a java project that I need help trying to finish. I have most of it completed but the issue I am running into is adding numbers with different lengths. Project requirements: . Use a Stack ADT with the implementation of your choice (Array or Link), it should not make a difference 2.Read two “integer” numbers from the user. Hint: You don’t need to use an int type when you read, it may be easier to parse the input...