Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

define a method printuniversitylocation() that has two string parameter…

Question

define a method printuniversitylocation() that has two string parameters and outputs as follows. end with a newline. printuniversitylocation() should not return any value.
ex: if the input is lewisburg bucknell, then the output is:
lewisburg is the location of bucknell university.
1 import java.util.scanner;
2
3 public class universitylocation {
4
5 / your code goes here /
6
7 public static void main(string args) {
8 scanner scnr = new scanner(system.in);
9 string universitylocation;
10 string universityname;
11
12 universitylocation = scnr.next();
13 universityname = scnr.next();
14
15

Explanation:

Step1: Define the method

public static void printUniversityLocation(String location, String university) {

Step2: Print the required output

System.out.println(location + " is the location of " + university + " University.");

Step3: Close the method

}

Answer:

public static void printUniversityLocation(String location, String university) {
    System.out.println(location + " is the location of " + university + " University.");
}