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]
2 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]2 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]2 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 of these is an example of an input?
boyakko [2]

Answer:

typing on a key board

this is the best Ans.

8 0
2 years ago
Technical skills are also called soft skills.<br> Question 9 options:<br> True<br> False
mestny [16]

The statement is false, technical skills are those that serve to perform a specific function and are also called hard skills.

Technical skills are skills that include knowledge in the mechanical, computer, mathematical or scientific area that will allow a good performance of specific tasks.

  • A person with technical or hard skills is able to apply specific methods, procedures and techniques in a specialized field.

  • Soft skills refers to the characteristics and personal competencies that show how a person copes with others, it is related to emotional intelligence.

Therefore, we can conclude that technical or hard skills are the practical knowledge necessary to perform specific tasks, while soft skills are those skills associated with the ability to interact effectively on a personal level.

Learn more about technical skills here: brainly.com/question/10976877

8 0
1 year ago
How to call a variable as a tag in react native.
Pepsi [2]

Explanation:

There is no need of adding template strings inside a <Text> component for adding strings in react-native. You can just use simple text and for variables, you can wrap it with curly braces

6 0
2 years ago
1. Write a program that declares an array named alpha with 50 components of the type double. Initialize the array so that the fi
Aleksandr [31]

Answer:

Explanation:

1. Write a program that declares an array named alpha with 50 components of the type double. Initialize the array so that the first 25 components are equal to the square of the counter (or index) variable and the last 25 components are equal to three times the index variable.  

  double alpha[50];

   for (int i=0;i<25;i++)

   {

       alpha[i]=i*i;

       alpha[i+25]=(i+25)*3;

  }

2. Output the array so that exactly ten elements per line are printed.  

   for (int i=0;i<50;i++)

   {

       cout<<i+1<<". "<<alpha[i]<<" ";

       if (((i+1)%10)==0)

       {

           cout<<endl;

       }

   }

3. Run your program again, but this time change the code so that the array is filled with random numbers between 1 and 100.  

   double alpha[50];

   for (int i=0;i<50;i++)

   {

       alpha[i]=rand()%101;

   }

   for (int i=0;i<50;i++)

   {

       cout<<i+1<<". "<<alpha[i]<<" ";

       if (((i+1)%10)==0)

       {

           cout<<endl;

       }

   }

4. Write the code that computes and prints the average of elements of the array.  

   double alpha[50],temp=0;

   for (int i=0;i<50;i++)

   {

       alpha[i]=rand()%101;

       temp+=alpha[i];

   }

   cout<<"Average :"<<(temp/50);

5. Write the code that that prints out how many of the elements are EXACTLY equal to 100.

   double alpha[50],temp=0;

   for (int i=0;i<50;i++)

   {

       alpha[i]=rand()%101;

       if(alpha[i]==100)

       {

           temp++;

       }

   }

   cout<<"Elements Exacctly 100 :"<<temp;

Please note:  If you put  each of above code to the place below comment  it will run perfectly after compiling

#include <iostream>

using namespace std;

int main()

{

   // If you put  each of above code here it will run perfectly after compiling

   return 0;

}

8 0
2 years ago
What is cpu write its parts<br>​
aev [14]

Answer:  a CPU is a central processing unit. They’re responsible for creating and executing instructionsl

Explanation:

6 0
2 years ago
Other questions:
  • Where do scanned documents go in windows 10?
    11·1 answer
  • Assuming you have a TCF free student checking account, how many maximum overdraft fees can you incur in one day?
    12·1 answer
  • Which CSS attribute would change an element's font color to blue
    15·2 answers
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    10·1 answer
  • State differences between title bar and menu bar​
    5·1 answer
  • Which are the 2 main elements that’s make up computer architecture?
    6·2 answers
  • What is the impact of VR on Educational Learning rather than games?​
    13·1 answer
  • Which operating system might cause the desktop background to change unexpectedly?
    7·1 answer
  • Your company is building a new architecture to support its data-centric business focus. You are responsible for setting up the n
    15·1 answer
  • Answer all of the questions,
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!