Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Suppose you have created a JavaScript event listener that responds to a pointerdown event for the square object by running the graspSquare() function. You want the graspSquare() function to begin by determining the coordinates of the pointerdown event relative to the top-left corner of the browser viewport or window. What should you place in the blank in the following code?
function graspSquare(e) {
_____
// additional commands
}
a.
let startingX = e.clientX;
let startingY = e.clientY;
b.
let startingX = e.offsetX;
let startingY = e.offsetY;
c.
let startingX = square.clientX;
let startingY = square.clientY;
d.
let startingX = square.pageX;
let startingY = square.pageY;
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- Use a GUI to open the file and display words Create another class called Word GUI that will be a complete JFrame with a menu bar and menus. There should be two menus: one called File and another called List. The File menu should have the menu items Open and Quit. The List menu should have five menu items: A, E, I, O, U. The content pane of the GUI should have a grid layout of one row and two columns. Clicking on File > Open should allow the user to choose a file. That file should be displayed in the left column, with the lines numbered (starting at 1). When the user clicks on List a choice can be made of one of the five vowels. Clicking on a vowel should list all the words starting with that vowel in sorted order in the right column. Each word should have the line number on which it appeared. Create a class to record the word and its line number Create a class called WordLine that will have two instance variables: a String for the word, and an int for the line number on which the word…arrow_forwardIn Java FX or Javaarrow_forward//3. toggleCommentSection//a. Receives a postId as the parameter//b. Selects the section element with the data-post-id attribute equal to the postId//received as a parameter//c. Use code to verify the section exists before attempting to access the classList//property//d. At this point in your code, the section will not exist. You can create one to test if//desired.//e. Toggles the class 'hide' on the section element//f. Return the section element function code so far passes a.b,c fails rest function toggleCommentSection(postId) { // If Post Id Is Passed, Return Undefined if (!postId) { return undefined; } else { // Else, Get All Comment Sections const commentSections = document.querySelectorAll('[data-post-id]'); // Loop Through Each Comment Section for (let i = 0; i < commentSections.length; i++) { const commentSection = commentSections[i]; // If Post Id Attribut Of Comment Section Is Equal To Post Id Passed Arg…arrow_forward
- TechPreferences Object: let user TechPreferences = { preferredDatabase: "MongoDB", backendFrameworks: ["Express.js", "Django"], frontend Frameworks: ["React", "Angular", "Vue.js"], mobileFrameworks: ["Flutter", "React Native"], preferredIDE: "VS Code", continuousIntegration: true, }; Write a JavaScript function to process the information in "userTechPreferences" and answer the following: Display the person's preferred database. Identify and display any backend frameworks used by the person. Output the frontend frameworks the person is familiar with. Create a list of mobile frameworks the person is interested in. Display the preferred Integrated Development Environment (IDE). Check if the person uses continuous integration and display the corresponding message.arrow_forwardYou can specify the coordinates for a Google map object by _____. a. passing the latitude and longitude in as the first and second arguments to its constructor b. calling itsLatLng()method, passing in the latitude as the first argument and the longitude as the second argument c. including a string containing the latitude and longitude as the value for thecenterproperty in the map options object literal passed in to its constructor d. modifying either the latitude or the longitude using itssetLat()orsetLng()methodarrow_forwardUsing Java: 1 Description of the Program In this assignment, you are asked to implement a graphical application that displays a list of courses. Briefly, this GUI will take the inputs (i.e., course information), store them in an array list, and display course information in the output area. Figure 1 shows the layout of the CourseDisplay GUI. Figure 1: A screenshot of the CourseDisplay GUI. 2 Details of the program You should have three Java files: 1. CourseDisplayFrame class that extends JFrame class (The main part of your program). 2. CourseDisplayViewer class, which contains the main method where a CourseDisplay object will be created, and the GUI will pop up (Suggested frame width of 450, and frame height of 400). 3. Course class, which is the class that models the Course objects (This file will be given to you). 1 In your CourseDisplayFrame class file, you should have the followings: • Input area: – A text label and a text field (suggested width of 30) for course code; – A text…arrow_forward
- 4. When a view posts data, an action method can use the ______________ property of the controller class to check whether all values in the model are valid. 1. ModelState 2. Model 3. ValidationModel 4. ViewBagarrow_forwardCreate a program that uses classes, polymorphism, and enums to monitor blizzards in Europe, with class members including the blizzard name, location, and snowfall amount, with a continuous menu to update, delete, display, search and add data stored in a collection. The application should have a menu that allow users to: • Add a new item to the collection. • Display all the items in the collection. • Search for a specific item. • Exit the application by pressing 0. The application should also display any error messages if the user enters invalid input. Coding Requirements: 1. Demonstrate applied use of foreground color and change in console title 2. Classes created and apply generics, abstract, and polymorphismarrow_forwardin c # i need to Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an interface named ITurnable that contains a single method named Turn(). The classes named Page, Corner, Pancake, and Leaf implement ITurnable. Create each class’s Turn() method to display an appropriate message. For example: The Page’s Turn() method should display You turn a page in a book. The Corner’s Turn() method should display You turn corners to go around the block. The Pancake's Turn() method should display You turn a pancake when it's done on one side. The Leaf's Turn() method should display A leaf turns colors in the fall. i keep getting errors Unit TestIncomplete Page class defined Unit TestIncompletePage class defined Build StatusBuild FailedBuild OutputCompilation failed: 3 error(s), 0 warnings NtTest5c104eb7.cs(12,26): error CS0246: The type or namespace name `ITurnable' could not be found. Are you missing `TurningDemo' using…arrow_forward
- in c # i need to Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an interface named ITurnable that contains a single method named Turn(). The classes named Page, Corner, Pancake, and Leaf implement ITurnable. Create each class’s Turn() method to display an appropriate message. For example: The Page’s Turn() method should display You turn a page in a book. The Corner’s Turn() method should display You turn corners to go around the block. The Pancake's Turn() method should display You turn a pancake when it's done on one side. The Leaf's Turn() method should display A leaf turns colors in the fall. i keep getting errors Unit TestIncompletePage class defined Build StatusBuild FailedBuild OutputCompilation failed: 3 error(s), 0 warnings NtTest3c897a9a.cs(12,26): error CS0246: The type or namespace name `ITurnable' could not be found. Are you missing `TurningDemo' using directive?NtTest3c897a9a.cs(23,7): error…arrow_forwardWhich of the above choices (A, B, C or D) retrieves an behaviorList for the zebraZirly Animal object? Assume any undeclared or uninitialized variables that are not shown in this code were correctly setup.Animal zebraZirly = // ... Omitted for brevity // A Behavior tempList = zebraZirly.getBehaviorList(); // B Behavior[] tempList = zebraZirly.getBehaviorList(); // C Behavior[] tempList = zebraZirly.getBehaviorList(behaviorList); // D Behavior[] tempList = this.behaviorList.length;arrow_forwardin C# i need to Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an interface named ITurnable that contains a single method named Turn(). The classes named Page, Corner, Pancake, and Leaf implement ITurnable. Create each class’s Turn() method to display an appropriate message. For example: The Page’s Turn() method should display You turn a page in a book.The Corner’s Turn() method should display You turn corners to go around the block.The Pancake's Turn() method should display You turn a pancake when it's done on one side.The Leaf's Turn() method should display A leaf turns colors in the fall. but I keep getting errors witch are Build StatusBuild FailedBuild OutputCompilation failed: 1 error(s), 0 warnings TurningDemo.cs(2,0): error CS1525: Unexpected symbol `usingSystem' Unit TestIncomplete Leaf class defined Build Status Build Failed Build OutputCompilation failed: 1 error(s), 0 warnings…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY