Question: Required Skills Inventory Write a method that takes arguments and returns no value Use parameter variables in a method body e Use relational operators to

 Required Skills Inventory Write a method that takes arguments and returns

Required Skills Inventory Write a method that takes arguments and returns no value Use parameter variables in a method body e Use relational operators to construct an expression Use logical operators to construct an expression e Use multiple if statements to get the computer to make a decision e Use math operators to construct an expression Use modulo operator to construct an expression e Use String literals to define a String value Use string concatenation operator to construct a String expression Qutput to console with System.out.print or System.out.println or System.out.printf Copyright 20217 Arizona State University - This content is protected and may not be shared, uploaded, sold, or distributed in whole or part. Copying any part of these instructions or any part of a solution and sharing online or otherwise in any form is a violation of copyright laws and the ASU Academic Integrity Policy. All violations will be prosecuted. Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info 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. Write (define) a public static method named printHighwayInfo, that takes as its only argument a highway number (the arguments will be an int). When this method is called, it should print out a String indicating if the highway is a primary or auxiliary, and if the highway goes east/west or north/south (see examples below). This method should have a return void return type. Examples: 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. printHighwayInfo(90) will print The 90 is primary, going east/west. printHighwayInfo(290) will print The 290 is auxiliary, serving the 90, going east/west. printHighwayInfo(185) will print The 185 is auxiliary, serving the 85, going north/south. You may wish to write some additional code to test your method Hints: You can use the modulus operator (%) to compute the reminder of an integer division operation. For example: 290 % 100 will evaluate to 90, because the remainder after dividing 290 by 100 is 90. As another example: 185 % 2 is 1, because 2 goes into 185, 92 times with 1 left over. Also, note that for any integer x, x % 2 will always evaluate to 1 when x is odd, and it will always evaluate to 0 when x is even. Need Help? Additional help resources are available by clicking on the words "Need Help?" at the bottom of this page, and search for help or ask a question! B m Y History Tutorial HighwayInfo.java & [ public class HighwayInfo { public static void main(String args) { // write some code to test your method here below O J o0 & W

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!