Question: Use variables to name, store, and retrieve values Use System.out.print to prompt the user for input Use a Scanner to collect user input Use math
Use variables to name, store, and retrieve values
Use System.out.print to prompt the user for input
Use a Scanner to collect user input
Use math operators to construct expression
Use explicit cast operation or Math methods to round values
Output to console with System.out.printf
UseRosie's Road Co is a new local construction company. They are interested in bidding on new highway construction projects around the city. They've hired you to develop some software tools that they will use to help determine material needs and costs.
Road development is not only the asphalt you see things like stoplights, and water and power conduits must be installed at the same time, and we have to account for things like labor costs and how long it will take to develop a particular project.
The city is very regular grid, with one way intersection at each mile of road. When asking for a quote, the city sends out the number of linear miles of road, and how many total lanes to
Other Details
There is one intersection for every mile of road
Each intersection has two stoplights, plus one additional stoplight for each lane
Stoplights cost $ per light
You must write a program that will collect, as input from the user, the number of miles of road as a double and the number of lanes this road will have as an int Your program must compute and store the following values: number of intersections an int number of stoplights needed as an int and total cost of the stoplights as a double Your program must then output these computed values a
Example
Enter the number of miles of road :
Enter the number of lanes on this road :
Number of intersections :
Number of stoplights :
Cost of stoplights : $
Example
Enter the number of miles of road :
Enter the number of lanes on this road :
Number of intersections :
Number of stoplights :
Cost of stoplights : $
hint:
There is one intersection for every mile of road
a mile mile road has intersection
a mile road has intersections
a mile road has intersections
Each intersection has two stoplights, plus one additional stoplight for each lane
a lane road has stoplights at each intersection
a lane road has stoplights at each intersection
a lane road has stoplights at each intersection
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
