1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
den301095 [7]
3 years ago
12

Hello, please help write code in C++. Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go nort

h/south, and evens (like the 10 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two-digits. Thus, the 405 services the 5, and the 290 services the 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. If the input is 90, the output is: The 90 is primary, going east/west. If the input is 290, the output is: The 290 is auxiliary, serving the 90, going east/west. If the input is not 1-999 such as 0, the output is: 0 is not a valid interstate highway number.
Computers and Technology
1 answer:
krok68 [10]3 years ago
3 0

Answer:

Please Find attached  c++ code file.

Explanation:

  1. Ask User to enter highway number.
  2. Check if highway is primary or auxiliary.
  3. Check if highway number is even / odd.
  4. Find Primary high number for an auxiliary highway

Check if highway is primary or auxiliary.

Use if condition to check if the entered number is in between 0 and 99.If it's true than the highway is primary otherwise it's an auxiliary highway.

Check if highway number is even / odd.

To check if a number is even or odd we use simple modulo formula. In mathematics modulo returns the reminder of a division operation on two numbers.If modulo of a number and 2 is equal to zero than that number is an even number other wise its an odd number.

(Any number ) mod 2 = 0

Find Primary high number for an auxiliary highway

As mentioned in the question last two digits of highway number is the number of primary high.

To Find last two digits of number apply modulo operation on highway number and 100. it will provide last two digits of number specifying our primary highway.

Download cpp
You might be interested in
A cloud implementation engineer successfully created a new VM. However, the engineer notices the new VM is not accessible from a
Rina8888 [55]

Answer:

Option A.

Explanation:

Incorrect subnet is the most likely problem in this scenario.

4 0
3 years ago
Many financial experts advise that property owners should insure their homes or buildings for at least 80 percent of the amount
serious [3.7K]
All I will say is good luck. because it can be very difficult to find someone that is willing to do this.
5 0
3 years ago
What is the fastest typing speed ever recorded? Please be specific!
Alex

Answer:

250 wpm for almost an hour straight. This was recorded by Barbara Blackburn in 1946.

7 0
3 years ago
Boosting morale in a workplace through reorientation is accomplished by giving employees _____. a. snacks and drinks b. the same
bixtya [17]
Snacks and Drinks (A)
4 0
3 years ago
Read 2 more answers
What is a example of a static web page. A. the about us page
inessss [21]

Answer:

bbbbbbbbbbbbbbbbbbbbb

5 0
3 years ago
Read 2 more answers
Other questions:
  • A(n) ____________________ defines the number and type of daemons that are loaded into memory and executed by the kernel on a par
    12·1 answer
  • You're working at a large industrial plant and notice a tag similar to the one shown in the figure above. Which of the following
    9·2 answers
  • If she presses the left arrow , what will happened
    15·1 answer
  • Given the following function definition
    13·1 answer
  • These items describe guidelines for the effective use of presentation graphics. Graphics should be large enough to be seen by th
    9·1 answer
  • Please tell fast plzzzzzz.​
    7·1 answer
  • Directions and Analysis
    15·1 answer
  • ALSO PLZZZ HELP :P Suppose you are purchasing a game at a local retail store that comes on DVD. In order to install it on your l
    8·1 answer
  • What is the expression for the resultant value of three capacitance where C1 connected in parallel​
    11·1 answer
  • You want to set the sticky bit on an existing directory, subdir, without otherwise altering its permissions. to do so, you shoul
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!