Answered step by step
Verified Expert Solution
Question
1 Approved Answer
TextEdit File Edit Format View Window Help 91%O Thu 6:38 AM Q IE *Homework Help - Q&A from Or x D2L 4-2 Assignment: Game Player
TextEdit File Edit Format View Window Help 91%O Thu 6:38 AM Q IE *Homework Help - Q&A from Or x D2L 4-2 Assignment: Game Player | X D21 Module Four Assignment Guide X + - C learn.snhu.edu/d21/le/content/1158564/viewContent/20018047/View Begin by importing the gameauth.zip file into Eclipse as a new Maven project. If you have not already practiced using Maven, be sure to follow the instructions in the Dropwizard Hello World Tutorial PDF. Note: You may need to update the dropwizard version in the pom.xml file to align with the version that you are using. To view the specific tasks you have been assigned, navigate in your Eclipse project to the Window, then Show View, then Tasks view. You can double-click on any of the tasks to be directed to the line of code where the task that needs to be completed is located. Specifically, review and complete all assigned tasks outlined below as indicated in the FIXME comments within the various Java files. A text version of this image is available: FIXME Text Version Word Document. . User Interface: Write code to create the user interface for entering data for user authentication and securing REST APIs with the proper annotation. To do this, you must complete the following tasks in the GameAuthApplication.java file based on the BasicAuth Security Example: o Register the GameUserREST Controller. . Create a JerseyClientBuilder instance named "DemoRESTClient". . Client: Write code to expose the Controller class and create a path for the client-side endpoint. To do this, you must complete the following tasks in the corresponding Java files: . GameUserRESTController.java: Add the proper annotation to expose this Controller class with the base endpoint URL as /gameusers. . RESTClientController.java: Add the proper annotation for the HTTP GET method and a path of /gameusers/ to expose an endpoint in order to return a list of all game users. . Authentication and Authorization (Server): Create a username and password-based authentication and role-based authorization for users, using annotations that set up permissions for the users. To do this, you must complete the following tasks in the corresponding Java files based on the BasicAuth Security Example: GameAuthenticator.java: Complete the Authenticator method by verifying a new instance of the GameUser class based upon the username that has been authenticated. GameAuthorizer.java: Complete the Authorizer method by roles of the user in the GameUser class based upon the username that has 22TextEdit File Edit Format t View Window Help 91% Thu 6:38 AM Q *Homework Help - Q&A from Or x D21 4-2 Assignment: Game Player | X D21 Module Four Assignment Guide X + C learn.snhu.edu/d21/le/content/1158564/viewContent/20018047/View GameAuthenticator.java: Complete the Authenticator method by verifying a new instance of the GameUser class based upon the username that has been authenticated. . GameAuthorizer.java: Complete the Authorizer method by roles of the user in the GameUser class based upon the username that has been authenticated. This completes the interface requirement for authentication using the Basic Authentication method. . User Protection and Security: Complete a REST Application including all classes, resources, and representations, along with APIs that request validation and are tested and verified using data provided. To do this, you must complete the following tasks in the GameUserRESTController.java file based on the BasicAuth Security Example: . Add the proper RolesAllowed annotation to restrict the createGameUser HTTP POST method to only authenticated users with the ADMIN role. . Add the proper RolesAllowed annotation to restrict the getGameUserByld HTTP GET method to only authenticated users with the USER role. o Test your code by running the application in Eclipse. Remember to add the values "server config.yml" as Program Arguments on the Arguments tab of Run Configuration. Use any web browser to visit the URL http://localhost:8080/gameusers. The browser's Basic Authentication dialog should appear with blank fields for Username and Password as shown below: Sign in http://localhost:8080 Username Password Sign in Cancel Valid usernames to try are "guest" "user" "player" and "admin" all with the same password value of "password" Unon successfulTextEdit File Edit Format View Window Help 91% Thu 6:38 AM Q IE . . *Homework Help - Q&A from Or X D21 4-2 Assignment: Game Player | X D21 Module Four Assignment Guide X + C learn.snhu.edu/d21/le/content/1158564/viewContent/20018047/View N Sign in http://localhost:8080 Username Password Sign in Cancel " Valid usernames to try are "guest", "user", "player", and "admin", all with the same password value of "password". Upon successful authentication, you will see the list of game players returned as a JSON string: [ { "id" :1, "firstName" : "Lokesh", "lastName" : "Gupta" , "email" : "India"} , {" id" :2, "firstName" : "John" , "lastName" : "Gruber" , "email" : "USA"} , {" id" :3, "firstName" : "Melcum", "lastName" : "Marshal", "email" : "AUS"} ] Visiting the URL http://localhost:8080/gameusers/1 while logged in as a user in the USER role will return the player whose ID is 1 (Lokesh Gupta). Visiting the URL with /2 will return the player whose ID is 2 (John Gruber), and so on. Close the browser, then reopen it and try accessing the same URL as a player or guest, and you should see the following JSON string displayed: { "code" : 403, "message" : "User not authorized."} . Industry Standard Best Practices: Be sure to demonstrate industry standard best practices in your code, including descriptive in-line comments and appropriate variable and method naming conventions. Guidelines for Submission 22Homework Help - Q&A from Or x Newton Second Law Lab.pdf X F C learn.snhu.edu/content/enforced/1158855-PHY-150-H1196-OL-TRAD-UG.22EW1/course_documents/Newton%20Second%20Law%20Lab.... N Newton Second Law Lab.pdf 11 / 17 136% + Activity 1: Newton's Second Law 1. Place two books close together on the table near the clamp pulley, one on either side of the string. Place them close enough to the clamp to prevent the cart from running into the pulley. Make sure the books do not interfere with the movement of the string. 19 2. Remove the rubber stopper and circular spring from the cart if attached. Use caution when removing the spring, as it can decompress quickly and become a projectile. 3. Tie a string to the cart through the hole where the rubber stopper was attached. 4. Place the cart on the table so the front edge rests against the stopping books. 5. Thread the string over the pulley and down to the floor. 10 6. Unbend a paperclip to make a hook where you can suspend the washers. See Figure 3. 7. Cut the string near the floor and tie the free end of the string to the paperclip. When the front edge of the cart rests against the books and the string is threaded over the pulley, the paperclip and the washers will be suspended just above the floor. 11 PHY 150 M4 Ne...docx Show All Xt Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x + C a learn.snhu.edu E Newton Second Law Lab.pdf 1359;, + [:1 03 Cart and final position was hers of C an start point and paint \""9\"\" m pap" clip 9 J Figure 4 8. Roll the cart backward on the table away from the books and pulley, until the paperclip is just below, but not touching. the pulley. Place a piece of tape in front of the front edge of the cart {see the tan start point indicated in Figure 4}. Label this tape as the start point or d = 0. 9. Place a second piece of tape on the table, across the path of the cart and even with stopping books. Label this tape as the end point. 10. Measure the distance from the start point to the end point. Record this value in Data Table l. 12 *3 PHY 150 M4 Nanndocx t Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x + C b learn.snhu.edu E Newton Second Law Lab.pdf 136% + E] (>3 11. Add six large washers and five small washers To The carT, and add four small washers To The paperclip on The end of The sTring. 12. Using The pockeT scale, measure The combined mass of The carT wiTh all The washers, The sTring, and The paper clip. This is The mass of The enTire sysTem, and This mass will remain cansTanT during The experimenT. Record The mass in DaTa Table l. 13. Place The carT behind The piece of Tape marking The sTarT poinT, and suspend The paperclip wiTh The iniTial four small washers over The pulley. See Figure 4 14. Release The sysTem and allow The suspended mass To fall. If The sysTem does noT move. Transfer one of The smaller washers from The carT To The paper clip hook. 15. Once you have successfully seT up The sysTem wiTh The iniTial condiTions ThaT will allow The suspended mass To acceleraTe The carT, use The pockeT scale and measure The mass of The paperclip wiTh The small washers. Record This value in DaTa Table l. 16. SeT up The carT, sTring. and suspended mass sysTem again. so ThaT The mass on The paperclip is suspended from The pulley and The carT is immediaTely behind The sTarT polnT as in Figure 4. The sTring should be TaughT so There is no slack. 12 *3 PHY 150 M4 Ne....dm:x t Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x + C b learn.snhu.edu E Newton Second Law Lab.pdf 136% + E] (>3 . Release The carT and simulTaneousiy sTarT The sTopwaTch. Shop The sTopwaTch when The carT conTacTs The sTopping books. 18. Record The Time in Dala Table 1. l9. RepeaT STeps 16 Through 18 Two more Times for a ToTol of Three Triais using The same number of washers To acceieraTe The sysTem. Record The Times for The Three in DaTa Table i. 20. Move one of The small washers from The carT To The paperclip. 21. RepeaT The procedure in sTeps 19-21, collecTing daTa for Three Trials wiTh The mass of an addiTionai washer acceleraTing The sysTem. 22. RepeaT The procedure using an increasing number of washers {up To seven washers] To acceleraTe The sysTem. 23. CalculaTe The force [N] acceleraTing The carT by mulTiplying The mass of The suspended washers and The paperclip by The acceleraTion due To graviTy g: 9.8 m/szi. NoTe: Mass is The amount of maTTer in an object. WeighT is The force of gravity on an objecT, which is provided in Newtons, N: ' *3 PHY 150 M4 Nanndocx t Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x + C o learn.snhu.edu E Newton Second Law Lab.pdf 1359;, + [:1 03 24. Calculate the average time of the three trials for each iteration of the experiment. 25. Calculate the square of each average time. 26. Calculate the acceleration of the system by using the Kinematics Equation: 1 s=at2 Where 5 is displacement {the distance that the cart moved from the start point to the end point]. t2 is the square of the time for the cart to move from the start point to the end point [in this experiment three times are averaged to minimize error} and a is the acceleration of the system. 015 Carolina Biological Supply Company en.un *3 PHY 150 M4 Ne....docx t Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x + C a learn.snhu.edu E Newton Second Law Lab.pdf 136% + Rearranging the preceding equation for acceleration gives: As the mass that is suspended over the pulley increases, the weight, or the force, accelerating the system increases, and therefore the acceleration of the system increases. 27. Construct a graph of force {H} vs. acceleration [m/szl. The force accelerating the system in each trial is the weight of the suspended mass. The slope of the line should be the mass of the entire system. According to Newton's Second Law of Motion, the relationship between force and acceleration is given by: F=ma In this experiment, the mass of the system, the cart, the string, the paperclip. and all the washers remained constant. The force accelerating the system was the weight of the washers. As the weight of the washers increased, so did the acceleration in a linear 14 relationship descn'bed by the orecedina eauation. m} PHY150M4Ne....docx A ShowAll t Homework Help QEA from -:' x {.j.' Newton Second Law Lab.pdf x C a learn.snhu.edu E Newton Second Law Lab.pdf 1359;, + [:1 03 According to Newton's Second Law of Motion, the relationship between force and acceleration is given by: F=ma In this experiment, the mass of the system, the cart, the string, the paperclip. and all the washers remained constant. The force accelerating the system was the weight of the washers. As the weight of the washers increased, so did the acceleration in a linear relationship descn'bed by the preceding equation. 28. Calculate the percent difference between the mass of the system determined experimentally using the slope of the line and the mass you recorded using the pocket scale. Remember to convert all masses to kilograms {kg}. first value second value pBTCBTLE difference : (first uaiue-tseccmd value) 2 x 100% 14 m} PHY 150 M4 Ne....docx Show All PHY 150 M4 Newton's Second Law Lab Report (1) - Saved to my Mac Q Home Insert Draw Design Layout References Mailings Review View RCM PERRLA . Tell me Share Comments Arial 16 A A Aa v 21 AaBbCcDdE 1. AaBbCc[ AaBbCcDdE V Normal Numbered Li.. No Spacing Styles Dictate Sensitivity MathType Paste B I Uvab A A Pane Activity 1: Newton's Second Law Data Table 1 Suspended | Weight of Time Average Average d (m) 2d Acceleration Mass (kg) Suspended | (sec) Time Time2 (m) = 2d/t2 Mass (mass x 9.8 m/$2) , Newtons 3 Washers Trial 1: Trial 2: Trial 3: 4 Washers Trial 1: Trial 2: Trial 3: 5 Washers Trial 1: Trial 2: Trial 3: Focus E 179% Page 2 of 3 214 words OF English (United States) +PHY 150 M4 Newton's Second Law Lab Report (1) - Saved to my Mac Q Share Comments Home Insert Draw Design Layout References Mailings Review View RCM PERRLA . Tell me Arial 16 A A Aa v AaBbCcDdE 1. AaBbCc AaBbCcDdE V Normal Numbered Li.. No Spacing Styles Dictate Sensitivity MathType Paste B I Uvab X X Av LAv IEv Pane Trial 3: 5 Washers Trial 1: Trial 2: Trial 3: 6 Washers Trial 1: Trial 2: Trial 3: 7 Washers Trial 1: Trial 2: Trial 3: Mass of Slope the system of the Line (kg) STEFFI EECEECEEE Page 2 of 3 214 words OF English (United States) Focus E 17 3 /0If} E (7 " L5 g D 7 ! PHY'lEO M4 Newton's Second Law Lab Report (1) Home Insert Draw Design Layout References Mailings Review View RCM I3 Share Cl Comments ,, _ Century Go... 11 . t. .. . \":3de AaBchDdE ' . v B I L] v {4.} x -"_ i ._ Numbered Li_. Na Spacing . y Dictate Sensitivity MthType Pane Insert your graph here for force {N} vs. acceleration [m/sQ}. Activity I: Questions for Newton's Second Law Question 1: According to Newton's Second Law F = ma. It the force applied to an object is doubled, what happens to the acceleration? Question 2: You observe a vehicle traveling on a highway. The vehicle is maintaining a constant velocity. What can you determine about the forces on the vehicle? Question 3: I What are some error sources in the Second Law experiment? Question 4: In the Second Law experiment, the acceleration is calcutated by measuring the time for the cart to move from the start point to the end point and apptying the kinematics equation: 1 =7 t2 S 2a Explain how this equation is used to find the acceleration. Page 3 of 3 21:1 words III? English IIUniterJ States
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started