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]
4 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]4 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
Will a logic error be found if a program is compiled?
natali 33 [55]
No. The computer dose not understand what you are attempting to do, therefore it will not understand how to check for logic errors. The compiler will only check for syntax errors.
6 0
3 years ago
Technological improvements have allowed people to inhabit a wider variety of places more easily. Please select the best answer f
muminat

The statement ‘Technological improvements have allowed people to inhabit a wider variety of places more easily’ is true. Technology has made our lives easier and faster. You can just buy a land or house from the developer to obtain a place you want.

9 0
3 years ago
Read 2 more answers
Margie has found a stock template to use. She changes a few things about the formatting and then saves the
asambeis [7]

Answer:

file open my documents

Explanation:

because if she saved it she would have to go to her documents to open it

6 0
3 years ago
Read 2 more answers
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
Margaret [11]

Explanation:

A.)

we have two machines M1 and M2

cpi stands for clocks per instruction.

to get cpi for machine 1:

= we multiply frequencies with their corresponding M1 cycles and add everything up

50/100 x 1 = 0.5

20/100 x 2 = 0.4

30/100 x 3 = 0.9

CPI for M1 = 0.5 + 0.4 + 0.9 = 1.8

We find CPI for machine 2

we use the same formula we used for 1 above

50/100 x 2 = 1

20/100 x 3 = 0.6

30/100 x 4 = 1.2

CPI for m2 =  1 + 0.6 + 1.2 = 2.8

B.)

CPU execution time for m1 and m2

this is calculated by using the formula;

I * CPI/clock cycle time

execution time for A:

= I * 1.8/60X10⁶

= I x 30 nsec

execution time b:

I x 2.8/80x10⁶

= I x 35 nsec

6 0
3 years ago
99 Point question
icang [17]
Smartart is your answer! Hope this helps
3 0
4 years ago
Read 2 more answers
Other questions:
  • While waiting to be seated at a restaurant, Jason receives a customer loyalty coupon through an app on his mobile phone for half
    7·1 answer
  • If object B inherits from object A, then which of the following statements is true?
    15·1 answer
  • Which of the following is a feature that allows you to temporarily store text? A wordvault, B Clipboard,C Normal View, D typeove
    5·1 answer
  • 4. A computer architect boasted that they were able to design a computer in which every instruction occupied exactly thirty-two
    8·1 answer
  • What is interest? How does interest affect credit card purchases?
    11·1 answer
  • ______________ in SONET are analogous to the ________________ of T-carriers.
    7·1 answer
  • Tables should be used when (a) the reader need not refer to specific numerical values. (b) the reader need not make precise comp
    14·1 answer
  • An array similar to a phone book has 1000 names arranged as names [0], names[1]....names[999]. Nancy wants to search a name X in
    15·1 answer
  • status is a non-volatile memory chip used for store translation data between personal computer PC and digital device ​
    8·1 answer
  • A vpn is used primarily for which purpose?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!