subject

In this homework you will print details about a US Interstate Highway given that highway's number Interstate Highways
US Interstate Highways (the ones with blue shield icons, like this) are given very deliberate numbers that reflect their physical characteristics. Knowing an interstate's number can tell you a lot about it: whether it's a large or small highway, what direction it runs, and more! Some simple math will derive facts about an interstate given its number:
1. Interstates are either primary or auxiliary routes. A primary route has a one or two-digit number, whereas an auxiliary route has a three-digit number
2. Primary routes have: o an orientation, an odd route number indicates a north-south orientation, and an even number indicates an east-west orientation. Example: Interstate 5 runs north-south, Interstate 10 runs east- west. o a size a route number that is a multiple of 5 is a long-distance arterial highway. Example: Interstates 5, 10, 15, etc. are long- distance arterial highways, but not 8, 11, 14, etc.
3. Auxiliary routes have: . a type: if the first digit of the route number is odd, the auxiliary highway is a spur highway. If the first digit of the route number is even, the highway is a loop highway. Example: 110 is a spur highway. 405 is a loop highway. . a parent every auxiliary highway has a "parent" primary highway that it connects to. The parent highway number is the last two digits of the auxiliary number. Example: the parent of 605 is 5; the parent of 710 is 10.
Easy!
Assignment
Write a Python program to:
1. Ask the user to input an integer highway number. You may assume the user always enters a single integer value; for example, if the user is interested in Interstate 405, they will enter 405. You must validate the value of this input: ensure that the value is between 0 and 999 inclusive, and continually loop and ask the user for a highway number until they enter one that matches this requirement. Do not proceed with the rest of the program until you are sure the user gave a number between 0 and 999.
2. Determine (but don't print... yet) whether the highway is primary or auxiliary.
3. Print a summary of the highway's information (SEE EXAMPLE OUTPUT):
1. For primary highways, include whether the highway is a long-distance arterial, then give its orientation.
2. For auxiliary highways, include the auxiliary type and its parent highway number.
4. Repeat steps 1-3 until the user gives a highway number of O. Do not print any information about this highway, a value of 0 triggers the end of the program
Example output
User input is in italics:
Please enter a US Interstate Highway route number: -1
Please enter a US Interstate Highway route number: 5 Interstate 5 is a long-distance arterial highway oriented north-south.
Please enter a US Interstate Highway route number: 1000
Please enter a US Interstate Highway route number: 405 Interstate 405 is a loop highway of Interstate 5.
Please enter a US Interstate Highway route number: 94 Interstate 94 is oriented east-west.
Please enter a US Interstate Highway route number: 0

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
To fill (copy) a cell across or down, point to the of the cell and drag. top left corner top right corner bottom left corner bottom right corner
Answers: 3
question
Computers and Technology, 24.06.2019 17:40
Pseudocode pld #6, pg. 117 start// declarations// number numbertoguess// number myguess; numbertoguess = 92// while myguess ! = numbertoguess// output " guess an integer number between 1 and 100"// input myguess// if (myguess == numbertoguess)// output "you guessed the correct number"// else// output "the number you guessed was incorrect. try again! "// end if// end while// output " for playing the guessing game. have a great day! "// stop
Answers: 3
question
Computers and Technology, 25.06.2019 05:50
Acolor class has three public, integer-returning accessor methods: getred, getgreen, and getblue, and three protected, void-returning mutator methods: setred, setgreen, setblue, each of which accepts an integer parameter and assigns it to the corresponding color component. the class, alphachannelcolor-- a subclass of color-- has an integer instance variable, alpha, containing the alpha channel value, representing the degree of transparency of the color. alphachannelcolor also has a method named dissolve (void-returning, and no parameters), that causes the color to fade a bit. it does this by incrementing (by 1) all three color components (using the above accessor and mutator methods) as well as the alpha component value. write the dissolve method.
Answers: 2
You know the right answer?
In this homework you will print details about a US Interstate Highway given that highway's number I...
Questions
question
Mathematics, 19.08.2021 20:50
question
Mathematics, 19.08.2021 20:50
question
Mathematics, 19.08.2021 20:50
question
Biology, 19.08.2021 20:50
Questions on the website: 13722363