[SOLVED] make sure you do the extra credit

I don’t know how to handle this Computer Science question and need guidance.

Struggling to find relevant content or pressed for time? – Don’t worry, we have a team of professionals to help you on
[SOLVED] make sure you do the extra credit
Get a 15% Discount on this Paper
Order Now
  1. SUMMARY
  1. You will be calling a weather web service that provides current weather info for a given city and comparing the weather between two cities the user provides.
  1. This lab will involve the following new features:
    1. Consuming a REST web service.
    2. Utilizing Google’s Gson library to convert json to java objects.
  1. DETAILS

  1. Create a normal java application project like we’ve done before.
  2. Download the gson jar file provided with this lab. You need to add the jar file to your project like we’ve done in the past (see previous postings on how to do this).
  3. First create the java classes that the gson library will fill with incoming json data.
    1. These java classes will model the json that is returned from the weather web service.
    2. Here is what the returned json looks like:

{

“coord”:{“lon”:-116.96,”lat”:32.79},

“weather”:[

{“id”:800,”main”:”Clear”,”description”:”clear sky”,”icon”:”02d”}

],

“base”:”stations”,

“main”:{

“temp”:71.6,

“pressure”:1019,

“humidity”:14,

“temp_min”:68,

“temp_max”:75.2

},

“visibility”:16093,

“wind”:{“speed”:2.95,”deg”:234},

“clouds”:{“all”:5},

“dt”:1479581760,

“sys”:{

“type”:1,

“id”:476,

“message”:0.1939,

“country”:”US”,

“sunrise”:1479565376,

“sunset”:1479602637

},

“id”:5345529,

“name”:”El Cajon”,

“cod”:200

}

  1. All we care about is getting the value “name” and values from “main” like “temp” “temp_min” and “temp_max”.
  2. So we will 2 create java classes to mirror this relationship:

IMPORTANT: Remember that you can add a package from the File > New menu. All these files go in “com.grossmont.ws”. When you create a new class, just right click on the package folder you want to add the class to.

NOTE: You’ll notice that the instance variable names below match the json fields passed back. That matching is necessary for gson to be able to map the json to your fields.

  1. Weather_main.java
    1. This is just the “main” object portion of the json that holds the below fields.
    2. Package: com.grossmont.ws
    3. Create five public instance variables:
      1. All are float type — temp, pressure, humidity, temp_min, temp_max
        1. You’ll notice that in the above json sample, there is a mapping of main and inside main are these five variable names.
  1. Weather.java
    1. This is the root object that holds the top most fields in the returned json.
    2. Package: com.grossmont.ws
    3. Create two public instance variables:
      1. main – this is Weather_main type that you built above.
      2. name – this is String type.
  1. WeatherServiceManager.java (this class was provided to you with this lab doc).
    1. You need to put this file in the src/com/grossmont/ws folder in your project.
    2. You will fill in code where you see the ######## markings:
      1. Simply follow the guidelines in the java file.
    3. You are essentially wiring in the classes you just created to methods that retrieve data from them.
  1. EXTRA CREDIT option (5 points)
    1. Use these classes in a web site in Tomcat, and use JSP pages to get user input for just one city and show the three values for that city (current temp, high, low).
    2. Look back to lab 9 as a guide on how to put your class package folders into a …/WEB-INF/classes folder and how to instantiate and use your class in a JSP page.
    3. Reminder – since we’re using the gson jar file, you’ll need to put this in a …/WEB-INF/lib folder.
    4. You should have two JSP pages:
      1. one to get a city from the user in a form which submits those values to the second page.
      2. A second page to process the submitted user city.
        1. It needs to import and instantiate your WebServiceManager class.
        2. It needs to get the incoming parameter of city.
        3. It needs to take out any spaces (see main method in WebServiceManager class).
        4. It needs to display current temp and high & low.
  1. TURNING IN LAB:
  1. Turn in the above 3 files into your lab 11 assignment spot in Canvas.
  2. If you did the extra credit, also turn in your two jsp pages.
  3. IMPORTANT: DO NOT ZIP your folders/files please.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
Sign up, place your order, and leave the rest to our professional paper writers in less than 2 minutes.
step 1
Upload assignment instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
s
Get personalized services with MyCoursebay
One writer for all your papers
You can select one writer for all your papers. This option enhances the consistency in the quality of your assignments. Select your preferred writer from the list of writers who have handledf your previous assignments
Same paper from different writers
Are you ordering the same assignment for a friend? You can get the same paper from different writers. The goal is to produce 100% unique and original papers
Copy of sources used
Our homework writers will provide you with copies of sources used on your request. Just add the option when plaing your order
What our partners say about us
We appreciate every review and are always looking for ways to grow. See what other students think about our do my paper service.
Human Resources Management (HRM)
Thank you so much.
Customer 452701, August 14th, 2023
Nursing
Always pleased with the writers work.
Customer 452707, September 9th, 2023
Education
Thank you so much for all the help, I really appreciate it!
Customer 452631, November 3rd, 2021
Other
GREAT
Customer 452813, June 25th, 2022
Nursing
Writer went above and beyond. Can't believe how much work they put in for the price.
Customer 452707, July 10th, 2022
Other
GREAT
Customer 452813, July 3rd, 2022
Nursing
Everything was done thoroughly and with care. Awesome job!!!
Customer 452453, April 10th, 2021
Human Resources Management (HRM)
Thank you
Customer 452531, May 19th, 2021
Nursing
Everything was done perfectly. Thank you.
Customer 452707, June 15th, 2022
Literature
Thank you , this is perfect !
Customer 452795, May 15th, 2022
Social Work and Human Services
Great Work!
Customer 452587, August 31st, 2021
Nursing
Thank you!!!
Customer 452557, June 26th, 2021
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat

Good News ! We now help with PROCTORED EXAM. Chat with a support agent for more information