2. Next to the above two lines, write a Java program to create two individual classes: Address and Location. Below is the specification of "Address" and “Location" classes. Class Name Members Address...


Java Question - Instructions are in the attached pictures. The picture titled "Screenshot..." are the instructions for building the specific code, while the "Final Output" picture shows what the output of the code should look like. Thank you.


2. Next to the above two lines, write a Java program to create two individual classes: Address and Location.<br>Below is the specification of

Extracted text: 2. Next to the above two lines, write a Java program to create two individual classes: Address and Location. Below is the specification of "Address" and “Location" classes. Class Name Members Address 4 private String variables: numberAndStreet, city, state, zipcode Location 1 parameterize constructor default constructor Requirements In the default constructor, ask users to enter number and stree, then ask users to enter city. Continue to ask for entry of state and zipcode. Make sure the parametized constructor have two parameters “It" and "Ig" of double type. 391 Java Programming – Penniel P. Wu, PhD Use the system.out.println() method to display the entered address. Use the system.out.printIn() method to display the entered location with a string literal "https://www.google.com/maps/e", so the output will looks something similar to: https://www.google.com/maps/833.8121.- 117.921 3. Create another class named "GPS" as a composition class (aka "composite" class) that uses a parameterized constructor containing two parameters (named “It" and "Ig"). Use these two parameters to take two values (latitude and longitude) from the user. Below is the figure that explain their relations. GPS Address Location 4. Inside the parameterized constructor, create one instance of the “Address" class and one instance of the "Location" class. Be sure to pass the value store in both “It" and “Ig" parameters from the "GPS" constructor to the parameterized constructor of the “Location" class. 5. In the "main" method of the main class, create two variables of double type named “lat" and “lon". Then, ask the user to enter the values of latitude and longitude and store the entries in these two variables. 6. Create an instance of GPS, and pass the value stored in “lat" and "lon" to both “It" and “lg" parameters of the GPS constructor. Make sure the output looks similar to the following.
Enter the latitude: 33.9222705<br>Enter the longitude: -117.6385886<br>Enter the number and street: 101 Main Street<br>Enter the city: Los Angeles<br>Enter the state: CA<br>Enter the zipcode: 90210<br>101 Main Street<br>Los Angeles, CA, 90210<br>https://www.google.com/maps/@33.9222705.-117.6385886<br>

Extracted text: Enter the latitude: 33.9222705 Enter the longitude: -117.6385886 Enter the number and street: 101 Main Street Enter the city: Los Angeles Enter the state: CA Enter the zipcode: 90210 101 Main Street Los Angeles, CA, 90210 https://www.google.com/maps/@33.9222705.-117.6385886
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here