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
Lesechka [4]
3 years ago
10

Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and events (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.

Computers and Technology
2 answers:
Norma-Jean [14]3 years ago
4 0

Answer:

The C code for the problem is given below

Explanation:

#include <stdio.h>

int main() {

   int highwayNumber;

   int primaryNumber;

   scanf("%d", &highwayNumber);

   if (highwayNumber >= 1 && highwayNumber <= 999) {

       if (highwayNumber <= 99) {

           if (highwayNumber % 2 == 0) {

               printf("I-%d is primary, going east/west.\n", highwayNumber);

           } else {

               printf("I-%d is primary, going north/south.\n", highwayNumber);

           }

       } else {

           primaryNumber = highwayNumber;

           highwayNumber %= 100;

           if (highwayNumber % 2 == 0) {

               printf("I-%d is auxiliary, serving the I-%d, going east/west.\n", primaryNumber, highwayNumber);

           } else {

               printf("I-%d is auxiliary, serving the I-%d, going north/south.\n", primaryNumber, highwayNumber);

           }

       }

   } else {

       printf("%d is not a valid interstate highway number.\n", highwayNumber);

   }

   return 0;

}

poizon [28]3 years ago
4 0

Answer:

CODE IN C++:

#include <iostream>

using namespace std;

int main()

{

int inputNumber ;

cout << "Enter an interstate highway number:";

cin >> inputNumber ;

if(inputNumber<=0 || inputNumber >= 1000)

cout << inputNumber << " is not a valid interstate highway number" << endl ;

else{

if(inputNumber > 99){

cout << "I-"<<inputNumber<< " is auxiliary, ";

int temp = inputNumber % 100 ;

cout <<"serving I-"<<temp<<", ";

if(temp%2==0){

cout << "going east/west." << endl;

}

else{

cout << "going north/south." << endl;

}

}

else{

cout << "I-"<<inputNumber<< " is primary, ";

if(inputNumber%2==0){

cout << "going east/west." << endl;

}

else{

cout << "going north/south." << endl;

}

}

}

return 0;

}

OUTPUT:

[ find attachment ]

You might be interested in
Which command let’s you increase or decrease the on-screen magnification of your document
JulijaS [17]
Ctrl - and ctrl +       i hope that is good for you                         
8 0
3 years ago
A Python function cannot under normal circumstances reference a module variable for its value.
marishachu [46]
This is false because
6 0
3 years ago
Read 2 more answers
What role does the automated surface observing system.
Ilya [14]

Answer: The ASOS systems serves as the nation's primary surface weather observing network. ASOS is designed to support weather forecast activities and aviation operations

6 0
2 years ago
Read 2 more answers
I analyze data, as a consultant, for companies making important business decisions. In order to get my point across, which of th
ladessa [460]

Answer:

3

Explanation:

I've just taken the test and made a 100. 3 is the most logical answer aswell, it has more of an effect than the others.

4 0
3 years ago
Greg works for an online games development company. He is not a net freak, but occasionally he visits online literature sites an
sweet-ann [11.9K]

Answer:

i think its A

Explanation:i hope i helped

5 0
3 years ago
Other questions:
  • What term is used to describe a chipset developed and promoted by the U.S. government from 1993 to 1996 as an encryption device
    9·1 answer
  • In Excel, what happens to the cell contents when you click and drag a cell into multiple cells?
    14·1 answer
  • Which statement describes borders and shading ?
    13·1 answer
  • The ____ is the point in the past to which the recovered applications and data at the alternate infrastructure will be restored.
    15·1 answer
  • True or False: Changing a bid package's status to "Closed" removed it from the bidder's Planroom and the bidder will no longer b
    15·1 answer
  • A network administrator is reviewing a network design that uses a fixed configuration enterprise router that supports both LAN a
    8·1 answer
  • The ____ is a tool in versions of microsoft office starting with office 2007 that consists of tabs, which contain groups of rela
    7·1 answer
  • Which is not a MARKETING impact of technology?
    9·1 answer
  • Two girls were born to the same mother, on the same day, at the same time, in the same month and the same year and yet they're n
    7·1 answer
  • Also have a good day people !!
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!