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
Question
task 18 in java
please include comments on the code so i can understand it better.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 3 images
Knowledge Booster
Similar questions
- Writing a Modular Program in Java Summary In this lab, you add the input and output statements to a partially completed Java program. When completed, the user should be able to enter a year, a month, and a day to determine if the date is valid. Valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31. Instructions Notice that variables have been declared for you. Write the simulated housekeeping() method that contains input statements to retrieve a year, a month, and a day from the user. Add statements to the simulated housekeeping()method that convert the String representation of the year, month, and day to ints. Include the output statements in the simulated endOfJob()method. The format of the output is as follows:month/day/year is a valid date. or month/day/year is an invalid date. Execute the program entering the following date: month = 5, day = 32, year =2014Observe the output of this…arrow_forwardJava requires its method arguments to be sent in as values, not references. And what, precisely, does it entail?arrow_forwardWrite a code in Java programming You are working in a game company that is developing a new RPG game. One of the core features of the game is the ability to create and manage different types of characters, such as warriors, mages, and archers. However, your colleague, who was previously working on the implementation of the CharacterManager class, has been laid off due to excessive absences. You have been assigned to take over the project and complete the implementation of the class based on the design specifications outlined below: Given the following main method: public static void main(String[] args) { CharacterManager manager = CharacterManager.getInstance(); manager.createCharacter(CharacterType.WARRIOR).attack(); manager.createCharacter(CharacterType.MAGE).attack(); manager.createCharacter(CharacterType.ARCHER).attack(); } Your output should be: Warrior is attacking Mage is attacking Archer is attacking Note that you should not change the method signature.arrow_forward
- Q1. Write two Java classes for calculating the power m" using the recursive method as follow: Class A A. Define two private variables in the class: names n and m. B. Define a constructor takes two parameters m and n and assign them to the class variables. C. Define setter and getter methods. D. Define a recursive method which take two parameters n, m and calculates the power using recursion. Class B: A. Define the main method. B. Define an object of class A and call its constructor which takes two parameters C. Call all the defined methods in Class A. Send the values 4,5 when call the recursion method. Attach File Browse My Computerarrow_forwardJava Language I want to round up the answer. How to use it in java? public static double calculateBMI(double height, double weight) {return 703 * weight / (height * height);}arrow_forwardFor the code in java below it shows a deck of 52 cards and asks the name of the two players and makes both players draw five cards from the deck. What I want to be added onto the code is the possibility for Player A too chose whatever card they want from his/her 5 cards and Player B has to chose two cards from his/her 5 cards that equal in value of Player A's card. I also want the cards that have been used to be replaced by different cards in the deck of 52 cards and that game to go on until the deck runs out of cards. Main class code: import java.util.ArrayList; import java.util.Scanner; import java.util.List; import java.util.Random; class Main { publicstaticvoid main(String[] args) { // card game, two players, take turns. String[] suits = {"Hearts", "Clubs", "Spades", "Diamonds"}; String[] numbers = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"}; for(String oneSuit : suits){ for(String num : numbers){ System.out.println(oneSuit + " " + num); } }…arrow_forward
arrow_back_ios
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