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
What is internet protocol? Language computers use to communicate over the internet Small files that websites put on your PC to s
Alex787 [66]

Answer:

Unique 32-bit number assigned to every machine on the internet

Explanation:

Internet Protocol is a numerical representation that uniquely identifies a device on a network, like Internet for instance. An IP address is an address used in order to uniquely identify a device on an IP network. The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask.

An IPv4 address contains 4 octets, so it's a total 32 bits long while addresses in IPv6 are 128-bits long.

7 0
3 years ago
Read 2 more answers
3.
Viktor [21]
3. <span>for the mother to stay home to tend to the household and care for the children while the father worked to support the family

4. true (not 100% sure)</span>
5 0
2 years ago
18. Applying what formatting option to your Excel workbook will make it easier to read when printed out?
Sergeu [11.5K]
Depending on the data all answers can be used to make it easier to read. Without more info I would go with Borders (D) since they are the best way to group the data when printed, especially if the print is in color.

Alignment would be the correct answer only if the data goes out of cell boundaries. Font Color usually makes it harder to read because of bad contrast and finally changing the Font Style has a minimal effect since the default one is already pretty readable.
7 0
3 years ago
This is your code. &gt;&gt;&gt; A = ['dog''red'] &gt;&gt;&gt; B = [' cat', 'blue']&gt;&gt;&gt;C = ['fish', 'green'] You can impl
natima [27]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The given Python code is:

>>> A = ['dog''red']

>>> B = [' cat', 'blue']

>>>C = ['fish', 'green']

We can implement an array of this data by using the dictionary in Python.

Dictionary in python:

A dictionary in python stores (key-value) pairs. For example, we can implement the -given arrays A, B, and C in the dictionary as given below:

d={'dog : red', 'cat : blue', 'fish : green'}

print(d['dog']) # Get an entry from a dictionary; prints "red"

print('cat' in d)    # Check if a dictionary has a given key; prints "True"

d['fish'] = 'black'    # Set an entry in a dictionary

print(d['fish'])      # Prints "black"

# print(d['elephant'])  # KeyError: 'elephant' not a key of d

print(d.get('elephant', 'N/A'))  # Get an element with a default; prints "N/A"

print(d.get('fish', 'N/A'))   # Get an element with a default; prints "black"

del d['dog']        # Remove an element from a dictionary

print(d.get('dog', 'N/A')) # "dog" is no longer a key; prints "N/A"

3 0
2 years ago
Read 2 more answers
Write a program named Deviations.java that creates an array with the deviations from average of another array. The main() method
Westkost [7]

Answer:

hello your question is incomplete attached is the complete question and solution

answer : The solution is attached below

Explanation:

Below is a program named Derivations.java that creates an array with the deviations from average of another array.

3 0
3 years ago
Other questions:
  • Which button would you use to quickly add addresses to a mail merge envelope?
    5·1 answer
  • The "network of networks," consisting of LANs (Local Area Networksnetworks connecting two or more computers, usually within the
    5·1 answer
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • Select the three reasons that the gaming industry is set to grow.
    12·2 answers
  • Which view in the View tab of the ribbon is the easiest place to add a header or a footer? Normal view Custom Views Page Layout
    5·2 answers
  • Define the term hardwar<br><br>​
    9·2 answers
  • 1. Create an optimized function "print s(n,s)" that prints the given argument s (representing a string) k times. k represents th
    7·1 answer
  • Find the distance between the points.<br><br><br>(5,-2),(-6,-2)
    12·1 answer
  • When we look for errors inside of our code on our own or with a partner , what is that called?
    9·2 answers
  • What do you mean by computer ethics?​
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!