Question: //ATTENTION ASNWER THE QUESTIONS IN THE BOTTOM IN JAVA package homework1; public class Main { public static void main(String[] args) { String question1and2 = GET
//ATTENTION ASNWER THE QUESTIONS IN THE BOTTOM IN JAVA
package homework1;
public class Main {
public static void main(String[] args) {
String question1and2 = "GET /add?a=3&b=4 HTTP/1.1 "
+ "Host: localhost:1298 "
+ "Connection: keep-alive "
+ "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 "
+ "Accept: image/webp,image/apng,image/*,*/*;q=0.8 "
+ "Referer: http://localhost:1298/ "
+ "Accept-Encoding: gzip, deflate, br "
+ "Accept-Language: en-US,en;q=0.9,es;q=0.8 ";
String question3 = "{ "
+ " task : inc, "
+ " num : 3 "
+ "} ";
String question4and5 = "To opt out, youll need to enter the Settings menu by clicking the three vertical dots, all the way in the upper right corner of the browser. From there, youll need to enter the Advanced settings at the very bottom and find the Allow Chrome sign in toggle, then turn it to off. Doing so lets you sign into Google services like Google mail and Maps without signing into the Chrome browser itself.";
System.out.println(question1and2);
System.out.println(question3);
System.out.println(question4and5);
// print each answer at the end
// Question 1
// Return the Host
// Question 2
// return sum of a and b
// Question 3
// convert to java object, increment num, convert back to json and return
// Question 4
// return unique words
// Question 5
// return 2nd most common word
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
