C++ 3.23 LAB: Interstate highway numbers   Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number.

Question

C++

3.23 LAB: Interstate highway numbers

 

Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90.

Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.

Ex: If the input is:

90

the output is:

I-90 is primary, going east/west.

Ex: If the input is:

290

the output is:

I-290 is auxiliary, serving I-90, going east/west.

Ex: If the input is:

0

the output is:

0 is not a valid interstate highway number.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Other

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Explain Request for proposal and its usage in gathering information about the hardware and system so...

A: To be determine: Explain Request for proposal and its usage in gathering information about the hardw...

Q: Give two use of system thinking

A: To be determine: Give two use of system thinking

Q: management system by using GUI and four principles of ja

A: Q.   Make a biscuits factory management system by using GUI and four principles of java Inheritanc...

Q: Help me write a program in Java to check if a matrix is a sparse or not.

A: Given, Programming language = JAVA We have to write a program in JAVA language to check if a matrix...

Q: We had two list and contain some elements are same then we have to remove the repeating elements fro...

A: Requirements :- Approach :- Assume two list filled with similiar entry then convert these lists int...

Q: Show the following is a valid sequent: P→R, Q→~R E~(P&Q)

A: Some Rules in Propositional Logic: Law of implication:    A → B = ~A ∨ B Rule of resolution:    A ∨...

Q: QUESTION 3 A USE statement is not required when Session is already in the context of the database wi...

A: - The question wants to know when is the use statement not required.   - A use statement is used to ...

Q: A...is a specialized computer that serves as a component of a bigger product.

A: In basic terms, computers are devices that carry out tasks as directed by their users. Several elect...

Q: I need the answer as soon as possible

A: Lets see the solution.

Q: . Given the follwing Frame control field (802.11 version,control,CTS, 1,0,1,1,0,1,1,0) From the abov...

A: In the IEEE 802.11 remote LAN protocol, (for example, Wi-Fi), a MAC outline is built of normal field...

Q: Draw the syntax diagram for the production rules below. A(10) i. ::= | ::= 0|1|2|3|4|5|6|7|8|9| ii....

A: Lets see the solution.

Q: The capacity to build robots with human-like intelligence is now within our grasp. Should we concen...

A: Below is the solution :

Q: Write a program in python to get extension of file. Like you take user input and file find the exten...

A: Requirements :- Approach :- Take the file name and then using pathlib library with path module and ...

Q: Show me how to use h1 heading tag in HTML. Use the heading as:  "HTML Headings" Write HTML code a...

A: Here have to determine about html code for h1 tag use.

Q: Write a program to take input three integers x,y,z from user and print the value of x*y - y*z - z*x ...

A: Introduction :We have asked to write a python code which will take input three integers x,y,z from u...

Q: Write Python statements that create two 5x5 numpy array with random integer values between [5, 15), ...

A: import numpy as np #create two 5x5 numpy array x = np.random.randint(-5,16, size=(5, 5)) y = np.rand...

Q: Python program Write a program in python to take a integer from user and print how many digits it ha...

A: Requirements :- Appproach :- take a number from user and then run a loop till the number becomes 0 ...

Q: Give two use of system thinking

A: Two use of system thinking

Q: Java A character array is given you have to make a string from that. Write a program for that

A: Required :- Java A character array is given you have to make a string from that. Write a program for...

Q: Subtract M from N using 2's complement method using Turing machine. Here, M, N are two binary number...

A: To subtract two binary numbers, 2's complement method is used.Here to find N-M, 2's complement of M ...

Q: Computer Science: _________ is defined as a property in which subsystems are dependent on each other...

A: Computer Science: _________ is defined as a property in which subsystems are dependent on each other...

Q: Develop a Python application that incorporates using appropriate data types and provides program out...

A: Given: Develop a Python application that incorporates using appropriate data types and provides prog...

Q: What exactly is a MAN? What is the difference between MAN and WAN?

A: A metropolitan area network (MAN) is a PC network that associates PCs inside a metropolitan area, wh...

Q: What are the applications of ICT?

A: ICT - Information and Communication Technology We have to write its applications.

Q: 9 detarls: first antenn nna is below in height by 20 (approximately)

A: Click to see the answer

Q: Explain Information systems analysis and design

A: Here have to determine about Information systems analysis and design.

Q: Write a class called course, which contains:

A: As no programming language is mentioned, it is solved using Python

Q: Python Module 2.1 Write a program to take input three integers x,y,z from user and print the value ...

A: code: x=int(input("Enter the x number: "))y=int(input("Enter the y number: "))z=int(input("Enter the...

Q: @Python programWrite a program that take a string as input and then sort the words of strings into a...

A: Requirements :- @Python programWrite a program that take a string as input and then sort the words o...

Q: Define the concept of distributed systems. What are the important implications of defining distribut...

A: Introduction: Three essential features of distributed systems are component competition, a global cl...

Q: Task4. ASCII code is a seven-bit code in which the decimal digits are represented by the BCD code pr...

A: Introduction :Here in this question we have asked to write the ASCII code for ' ELECTRONICS '.

Q: with alg

A: Below the bash  code  input is palindrome or not

Q: /*Question: what is the output after executed the following Program*/ #include using namespace std; ...

A: We can not use void main() in c++.  Because when we execute our program to identify it runs successf...

Q: at are some of the advantages of virtualization?

A: Required: What are some of the advantages of virtualization?

Q: The capacity to build robots with human-like intelligence is now within our grasp. Should we concen...

A: The capacity to build robots with human-like intelligence is now within our grasp. Should we concent...

Q: Integer in 64 bit operating system takes .                Bytes of memory. a) 2 Bytes  b) 1 Byte  ...

A: Integer is an primitive data type and it is used to store integers same as we define in Mathematics....

Q: Topic: Propositional Logic Guidelines: - type out the work (do not handwrite) - explain everything i...

A: Some rules in Propositional logic Law of implication:    A→B = ~A∨B Disjunctive syllogism:    A∨B, ...

Q: Show the following is a valid sequent: P→ (Q + R) F (P&Q) → R

A: Some Rules in Propositional Logic Law of implication:    A→B  = ~A∨B Distributive law:    A∨(B∧C) =...

Q: We had a file named a.txt and something is written on it. Write a program in python to over write th...

A: Required :- Approach :- Open the given file in writing mode so that all the data overwritten. then ...

Q: 2. Convert the following decimal numbers to their binary equivalents: a. 111 b. 34.75 с. 145 d. 27.1...

A: Given: As per our policy, "Since you have asked multiple questions, we will solve the first question...

Q: What are the benefits of distributed systems? (Explain its advantages and disadvantages)

A: Required: What are the benefits of distributed systems? (Explain its advantages and disadvantages)

Q: a computer language used to access and manipulate data contained in a relational database

A: SQL (Structured Query Language) is a normalized programming language that is utilized to oversee rel...

Q: Python please.write a program in python language that takes a string from user and a character also ...

A: Collections is a python in-built module which can be used to deal with the problem.Please refer to t...

Q: SN opcode n i x b p e Displacement Target Address (TA) 1 000000 1 1 0 0 1 0 0110 0000 0000 ...

A: Here we  find target address:

Q: /*Question:How many times is cS Department printed here after executed the following Program*/ #incl...

A: Here in this question we have given a code segment. And we have asked that what will be the output o...

Q: Explain Computer-Aided Software Engineering (CASE)

A: To be determine: Explain Computer-Aided Software Engineering (CASE).

Q: plain in fully why distributed systems are beneficial.

A: Required: Explain in fully why distributed systems are beneficial.

Q: Make a layout in Android Studio as shown in the blueprint shown below: Requirements 1. Imageview 2. ...

A: Given, We need to make a layout in Android Studio IDE to create a layout as shown in the blueprint....

Q: /*Question: what is the output after executed the following Program*/ #include using namespace std; ...

A: We have to find the output of the given program: #include <iostream>using namespace std;int ma...

Q: /*Question: what is the output after executed the following Program*/ #include using namespace std3;...

A: Given array of 8 elements Array[8]={2,4,6,8,10,12,14,16};  And two variables X,Y declared after loop...