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 small, electronic chip that a manufacturer develops for use in another product (such as a digital camera or microwave oven) is
Phantasy [73]

Answer:

The correct answer to the following question will be "Embedded Chip".

Explanation:

  • Embedded devices are a CPU chip positioned in a system that supports to improve the process. They are frequently confused with microprocessors, need other external elements, such as embedded storage and peripheral interfaces, to execute their specified tasks.
  • A thin, electronic device produced by the manufacturer to be used in another device is named as Embedded Chips.

Therefore, Embedded chips are the right answer.

3 0
3 years ago
Read 2 more answers
How can I do a project with a model on the steam machine?
user100 [1]
look up some facts about steam machines and then see when they were created and by who they were created and how they have evolved.
5 0
3 years ago
When you're working with a word processing document and you press the Del key, what happens? A. The paragraph you're working on
Bezzdna [24]
Option c. The entire document is deleted




4 0
3 years ago
To communicate with coworkers in the office
Elanso [62]

For effective communication to occur, everyone must trust and respect each other. ... Clear and concise communication will allow your colleagues to understand and then trust you. As a result, there will be more cooperation and less conflict in the workplace.

8 0
3 years ago
An expression that can’t be reduced any further is:
MakcuM [25]

Answer:

i think it’s b by process of elimination.

a value is just the value of number, fundamental isnt a math term, and variables change so

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • To move from layout view to form view, tap or click the _____ button on the access status bar.
    15·1 answer
  • Which is an example of Raw Input?
    11·1 answer
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • Write a C++ program that computes an approximation of pi (the mathematical constant used in many trigonometric and calculus appl
    15·1 answer
  • The base 10 number 18 is equal to which base 16 number?<br><br> 10<br><br> 12<br><br> 14<br><br> 16
    11·1 answer
  • The terms Apps and Applications can be used interchangeably about software installed
    8·1 answer
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • A field value is currently not in any group. what happens when you try adding it to an existing group?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!