Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util.Scanner; public class Stoplights { public static void main ( String [ ] args ) { / / Below this comment: declare and instantiate
import java.util.Scanner; public class Stoplights public static void mainString args Below this comment: declare and instantiate a Scanner Scanner sc new ScannerSystemin; Below this comment: declare any variables you may need double milesOfRoad; int lanes; int intersections; int stoplights; double costOfStoplights; Below this comment: collect the requried inputs from the user System.out.printEnter the number of miles of road : ; milesOfRoad scnextDouble; System.out.printEnter the number of lanes on this road : ; lanes scnextInt; Below this comment: compute and store the required output values Below this comment: disply the required results
import java.util.Scanner;
public class Stoplights
public static void mainString args
Below this comment: declare and instantiate a Scanner
Scanner sc new ScannerSystemin;
Below this comment: declare any variables you may need
double milesOfRoad;
int lanes;
int intersections;
int stoplights;
double costOfStoplights;
Below this comment: collect the requried inputs from the user
System.out.printEnter the number of miles of road : ;
milesOfRoad scnextDouble;
System.out.printEnter the number of lanes on this road : ;
lanes scnextInt;
Below this comment: compute and store the required output values
Below this comment: disply the required results
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started