M
Marie
Hi, Im new at Java and have to do an assignment on it. First thing I need help with is the computer I am trying to compile the java code on doesn't allow me to so if anyone can tell me if the below code works to so that usersinput the values of the int such as mcLane ect. that would be wonderful
The next problem I'm having is applying conditions to the ints such as mcLane having to be between 1-4, sum of all lanes (mc, ac, et) have to be greater less then or equal to 8 and sum of mcLane and acLane has to be less thenor equal to 4. I'm clueless whether to use a boolean condition or who to loop it back to the user input until the condition is met. Any help would begreatly appreciated, Thank you 
package Jtoll;
import java.util.Scanner;
public class Jtoll {public static void main(String[] args) {
int mcLane;
Scanner user_input = new Scanner(System.in);
System.out.println("Input number of MC lanes");
mcLane = s.nextDouble();
int acLane;
System.out.println("Input number of AC lanes");
acLane = s.nextDouble();
int etlane;
System.out.println("Input number of ET lanes");
etLane = s.nextDouble();
int costMcStaff;
System.out.println("Input cost of MC Staff");
costMcStaff= s.nextDouble();
int costAClane;
System.out.println("Input cost of running AC lane");
costAClane = s.nextDouble();
int costETlane;
System.out.println("Input cost of running ET lane");
costETlane = s.nextDouble();
int timeMClane;
System.out.println("Input time taken to process one vehicle in MC lane");
timeMClane = s.nextDouble();
int timeAClane;
System.out.println("Input time taken to process one vehicle in AC lane");
timeAClane = s.nextDouble();
int timeETlane;
System.out.println("Input time taken to process one vehicle in ET lane");
timeETlane = s.nextDouble();
int priceV1;
System.out.println("Input price for V1");
priceV1 = s.nextDouble();
int priceV2;
System.out.println("Input price for V2");
priceV2= s.nextDouble();
int priceV3;
System.out.println("Input price for V3");
priceV3 = s.nextDouble();
}
}
package Jtoll;
import java.util.Scanner;
public class Jtoll {public static void main(String[] args) {
int mcLane;
Scanner user_input = new Scanner(System.in);
System.out.println("Input number of MC lanes");
mcLane = s.nextDouble();
int acLane;
System.out.println("Input number of AC lanes");
acLane = s.nextDouble();
int etlane;
System.out.println("Input number of ET lanes");
etLane = s.nextDouble();
int costMcStaff;
System.out.println("Input cost of MC Staff");
costMcStaff= s.nextDouble();
int costAClane;
System.out.println("Input cost of running AC lane");
costAClane = s.nextDouble();
int costETlane;
System.out.println("Input cost of running ET lane");
costETlane = s.nextDouble();
int timeMClane;
System.out.println("Input time taken to process one vehicle in MC lane");
timeMClane = s.nextDouble();
int timeAClane;
System.out.println("Input time taken to process one vehicle in AC lane");
timeAClane = s.nextDouble();
int timeETlane;
System.out.println("Input time taken to process one vehicle in ET lane");
timeETlane = s.nextDouble();
int priceV1;
System.out.println("Input price for V1");
priceV1 = s.nextDouble();
int priceV2;
System.out.println("Input price for V2");
priceV2= s.nextDouble();
int priceV3;
System.out.println("Input price for V3");
priceV3 = s.nextDouble();
}
}