Fill in Order Details

  • Submit paper details for free using our simple order form

Make Payment Securely

  • Add funds to your account. There are no upfront payments. The writer will only be paid once you have approved your paper

Writing Process

  • The best qualified expert writer is assigned to work on your order
  • Your paper is written to standard and delivered as per your instructions

Download your paper

  • Download the completed paper from your online account or your email
  • You can request a plagiarism and quality report along with your paper

make sure you do the extra credit

  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.

WHAT OUR CURRENT CUSTOMERS SAY

  • Google
  • Sitejabber
  • Trustpilot
Zahraa S
Zahraa S
Absolutely spot on. I have had the best experience with Elite Academic Research and all my work have scored highly. Thank you for your professionalism and using expert writers with vast and outstanding knowledge in their fields. I highly recommend any day and time.
Stuart L
Stuart L
Thanks for keeping me sane for getting everything out of the way, I’ve been stuck working more than full time and balancing the rest but I’m glad you’ve been ensuring my school work is taken care of. I'll recommend Elite Academic Research to anyone who seeks quality academic help, thank you so much!
Mindi D
Mindi D
Brilliant writers and awesome support team. You can tell by the depth of research and the quality of work delivered that the writers care deeply about delivering that perfect grade.
Samuel Y
Samuel Y
I really appreciate the work all your amazing writers do to ensure that my papers are always delivered on time and always of the highest quality. I was at a crossroads last semester and I almost dropped out of school because of the many issues that were bombarding but I am glad a friend referred me to you guys. You came up big for me and continue to do so. I just wish I knew about your services earlier.
Cindy L
Cindy L
You can't fault the paper quality and speed of delivery. I have been using these guys for the past 3 years and I not even once have they ever failed me. They deliver properly researched papers way ahead of time. Each time I think I have had the best their professional writers surprise me with even better quality work. Elite Academic Research is a true Gem among essay writing companies.
Got an A and plagiarism percent was less than 10%! Thanks!

ORDER NOW


Consider Your Assignments Done

“All my friends and I are getting help from eliteacademicresearch. It’s every college student’s best kept secret!”

Jermaine Byrant
BSN

“I was apprehensive at first. But I must say it was a great experience and well worth the price. I got an A!”

Nicole Johnson
Finance & Economics

Our Top Experts

See Why Our Clients Hire Us Again And Again!


OVER

10.3k
Reviews

RATING
4.89/5
Average

YEARS
13
Mastery

Success Guarantee

When you order form the best, some of your greatest problems as a student are solved!

Reliable

Professional

Affordable

Quick

Using this writing service is legal and is not prohibited by any law, university or college policies. Services of Elite Academic Research are provided for research and study purposes only with the intent to help students improve their writing and academic experience. We do not condone or encourage cheating, academic dishonesty, or any form of plagiarism. Our original, plagiarism-free, zero-AI expert samples should only be used as references. It is your responsibility to cite any outside sources appropriately. This service will be useful for students looking for quick, reliable, and efficient online class-help on a variety of topics.