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
Aleks [24]
3 years ago
6

Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (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, 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. Ex: If the input is: 90 the output is: The 90 is primary, going east/west. Ex: If the input is: 290 the output is: The 290 is auxiliary, serving the 90, going east/west Ex: If the input is G here to search The 290 is auxiliary, serving the 90, going eas Ex: If the input is: 0 or any number not between 1 and 999, the output is: 0 is not a valid interstate highway number. See Wikipedia for more info on highway numbering LAB 4.16.1: LAB: Interstate highway numbers ACTIVITY LabProgr- 1 import java.util.Scanner; 2 3 public class LabProgram public static void main(Stringl] args) t Scanner scnr new Scanner(System.in); int highwayNumber; int primaryNumber; 4 5 6 7 highwayNumber scnr.nextInt(); 1e Type your code
Engineering
1 answer:
Gekata [30.6K]3 years ago
6 0

Answer:

The Java code is given below with appropriate variable names and tags for better understanding

Explanation:

import java.util.Scanner;

public class LabProgram{

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       int highwayNumber;

       int primaryNumber;

       highwayNumber = scnr.nextInt();

       if(highwayNumber<1 || highwayNumber>999)

           System.out.println(highwayNumber+" is not a valid interstate highway number.");

       else{

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

               System.out.print("The "+highwayNumber+" is primary, going ");

               if(highwayNumber%2==1)

                   System.out.println("north/south.");

               else

                   System.out.println("east/west.");

           }

           else{

               primaryNumber = highwayNumber%100;

               System.out.print("The "+highwayNumber+" is auxillary, serving the "+primaryNumber+", going ");

               if(primaryNumber%2==1)

                   System.out.println("north/south.");

               else

                   System.out.println("east/west.");

           }

       }

   }

}

You might be interested in
Exercise 19
musickatia [10]
Uhh idk this can u mabye look it up
6 0
4 years ago
What engine does the Lexus is300 have?
Nikitich [7]

Answer:

2jz - ge

Explanation:

it has the non turbo 2jz. its the engine the supra has

6 0
4 years ago
A sample of wastewater is diluted 10 times. The diluted solution has an ultimate biochemical oxygen demand (BOD), Lo, of 30 mg/L
zzz [600]

Answer:

474.59 mg/L

Explanation:

Given that

BOD = 30 mg/L

Original BOD  = 30 mg/L × dilution factor

Original BOD  = 30 mg/L  × 10 = 300 mg/L

L_o = \frac{BOD}{1-e^{-5t}}

here L_o is the ultimate BOD ; BOD is the  biochemical oxygen demand ;  t = 0.20 /day

L_o = \frac{300}{1-e^{-5(0.20)}}

L_o = 474.59 \ mg/L

3 0
4 years ago
What position would be the lowest paid in a technology company?
murzikaleks [220]
I think the answers is b
3 0
3 years ago
Technician A says that the micrometer operates on a simple principle: The spindle has 20 threads per inch, so one revolution of
svet-max [94.6K]

Answer:

Explanation:

neither of the technicians is correct

6 0
3 years ago
Other questions:
  • An aluminium bar 600mm long with diameter 40mm has a hole drilled in the centre of the bar. The hole is 30mm in diameter and is
    15·1 answer
  • Continuing education and seeking opportunities for relaxation are two types of professional development.
    14·2 answers
  • Refrigerant 22 flows in a theoretical single-stage compression refrigeration cycle with a mass flow rate of 0.05 kg/s. The conde
    15·1 answer
  • It is easy to say that an organization should hire, reward, and dismiss employees based on their character as well as their know
    11·1 answer
  • Mile markers appear as green signs.
    6·1 answer
  • A thick oak wall initially at 25°C is suddenly exposed to gases for which T =800°C and h =20 W/m2.K. Answer the following questi
    5·1 answer
  • Large quantities of liquefied natural gas (LNG) are shipped by ocean tanker. At the unloading port, provision is made for vapori
    6·1 answer
  • 1. Safety goggles, glasses, or face shields must be
    6·2 answers
  • Hello it's my new id<br>I am numu ​
    15·1 answer
  • Three natural materials that were used by early man as roof covering​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!