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
How do films use camera shots?
lorasvet [3.4K]
These advanced camera shots, or angles, are used in film to convey an effect or emotion rather than exemplify a sense of space. Before filming, cinematographers will write out their shot list in order to plan how each scene of their film should be shot
7 0
3 years ago
Read 2 more answers
A small amount of memory stored on the central processor for easy access is called
expeople1 [14]

The answer is : Cache.  It is a small amount of memory stored on the central processor for easy access.  Cache is where active data are placed for easier access, it stores recently used information so that it can be quickly accessed at a later time. Some types of cache are browser cache, disk cache, memory cache, and processor cache.

3 0
3 years ago
Read 2 more answers
Provides information of the active slide at the bottom of the slide
denis-greek [22]

I believe the answer is: Status bar

4 0
3 years ago
A(n) ______ is software that finds websites, webpages, images, videos, and other information related to a specific topic.
zzz [600]

Answer:

Search Engine

Explanation:

A search engine is used to crawl most of the web sites based on there content (mostly defined in metadata tag in web pages) in order to search information according to the given query submitted by user. Search Engine will then provides a list of matched results that user want to find.

3 0
3 years ago
A distinguishing feature of methods that have the reserved word void in the method header is that they have:.
aliina [53]

Answer:

no return statements

Explanation:

3 0
2 years ago
Other questions:
  • Approximately what percent of desktop PCs are used for work-related purposes?
    13·2 answers
  • The difference between a want and a need is a want is not necessary for survival. Things necessary for survival are known as ___
    6·1 answer
  • Which is a description of phishing?
    7·1 answer
  • Define the ADT list: its properties and methods
    14·1 answer
  • What are the features of Cobol language that make it suitable for programming business applications.
    6·1 answer
  • Why is the cyber community important???
    8·2 answers
  • Create a text file named employee.dat containing the following data: b. Write a C++ program to read the employee.dat file create
    6·1 answer
  • Exercise 3.6.9: 24 vs. "24"5 points
    7·1 answer
  • Quiz #1: In Fnaf 4 After chris gets bit by Fredbear what animatronic does he start to possess and how does he die?
    10·2 answers
  • 90 POINTS Hazel is working with a database to help determine if the company she works for is making or losing money. Hazel has o
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!