Given the class definitions of MPoint and Named Point below, which of the constructors would be valid class? (Select all that apply) class MPoint { private int myX; // coordinates private int myY; public MPoint() { myX= 0; myY= 0; } public MPoint(int a, int b) myx = a; myY = b; } } // ... other methods not shown } public class NamedPoint extends MPoint private String myName; // constructors go here // ... other methods not shown Opublic NamedPoint(int d1, int d2, String name) { myx = d1; myy=d2; myName = name; } Opublic NamedPoint() { myName = ""; } Opublic NamedPoint(int d1, int d2, String name) { super(d1, d2); myName = name; }
Q: Consider an ARQ protocol that uses only negative acknowledgments (NAKS), but no positive…
A: The answer is given in the below step
Q: What the impact of the data centre and the cloud computing on the Information system that Facebook…
A: A data center is a centralized organization that provides shared access to all the network devices.…
Q: 5) a) Consider the (7,4) hamming code with data word 1111 and evaluate the 7-bit composite code word…
A: Hamming code: It is used to detect and correct the errors in data when it is transferred from sender…
Q: The Internet of Things is not solely focused on home automation or private consumer products.…
A: IntroductionThe term "Internet of things" refers to physical items equipped with sensors, processing…
Q: Show how the decimal floating point number -76.310 is stored in the computer's storage using IEEE754…
A: Here in this question we have given a decimal number -76.3 and we have asked to convert it into IEEE…
Q: (a) Define digital watermarking technology.
A:
Q: Suppose an IP packet is fragmented into 10 fragments, each with a 1% (independent) probability of…
A: Assume an IP packet is fragmented into ten pieces, each with a 1% chance of loss. As a result, there…
Q: What security flaws are exploited and how may these issues be addressed in the future in the case of…
A: Introduction: Data damage is defined as any decrease in data integrity or availability. Damage to a…
Q: I am writing a method to remove the first element in a doubly linked list. However I am supposed to…
A: While handling exceptions, In the 'catch' block we need to provide exactly what our 'try' block can…
Q: What are the main differences between the BSS and ESS wireless topologies? Create the topologies and…
A: The Answer is in step2
Q: Suppose a bridge has two of its ports on the same network. How might the bridge detect and correct…
A:
Q: Change your Virtual Memory pagefile to the following capacity: Initial Size: 10MB Maximum size:…
A: We need to change the Virtual Memory pagefile of our system and provide steps and screenshots.
Q: When it comes to cloud security, what is the "shared responsibility" paradigm like?
A: Introduction: A shared accountability paradigms is kinds of clouds security models. The paradigm…
Q: Please do it with regular expression. Don't use loops please. Do fast, I have no time left Write a…
A: Step-1: StartStep-2: Declare a variable str and take input from userStep-3: Declare a variable…
Q: All the following hacking activities can result in session hijacking except for which one?…
A: In session hijacking, attackers take over the control over a session and act as if they are one of…
Q: Identify and correct the errors in each of the following statements: a) if ( c !< 17 );…
A: The answer is written in step 2
Q: How many times the following loop will be executed
A: Given Code:
Q: IP Address is 69.67.214.64/26 Subnet Mask: Maximum usable hosts: Network Address:…
A: IP Address given is 192.168.3.0/25 For creating 7 subnets, we here need to borrow at least 3 bits…
Q: es between nodes in an eight-node network is presented in the from-to distance table below. What is…
A: Here, from the question In the given problem, the graph contains 8 nodes from 1 to 8 in it..…
Q: Consider how important wireless networks are in today's countries that are still developing.…
A: Nowadays, most communication is wireless. It involves sending information over a shorter distance or…
Q: PROVIDE JS SOURCE CODE Design a web page with a text box (username) where the user can enter a name…
A: Source Code:- <!DOCTYPE html><html lang="en"><head> <meta…
Q: n C program. /* * dataStructure.h * * Provides a data structure made of a doubly-headed…
A: The question is asking me add a function to append a new element to a linked list. The answer is…
Q: Please do it with regular expression. Don't use loops please. Do fast, I have no time left Write a…
A: Regular expressions are he pattern used to match the characters combinations in the given strings.
Q: Please provide me a C program that prints the message "C Programming." in the output 10 times using…
A: Approach: The goto keyword is used in the program where we create labels in the program and the goto…
Q: A program to converts a binary value between 0 and 9 in R4 into its ASCII representation is to be…
A: Input: str = “0110000101100010”Output: abExplanation:Str is divided into 8 bits as follows: 01100001…
Q: What is the maximum bandwidth at which an IP host can send 576-byte packets without having the ldent…
A: Introduction: Bandwidth is frequently confused with web speed when really the volume of data can…
Q: Evaluate each of the following Javascript expressions and show the value. ‐9*3 “value is“+ 50…
A: -9*3=27 “value is“+ 50= value is 50 17%5=2 5%17=5
Q: Using HTML Create a web page that will prompt the user for a name and age, and write a message…
A: I have provided HTML CODE( having internal JS ) along with CODE SCREENSHOT and OUTPUT…
Q: This program was run once and the output was 15. If we run this program another 100 times how many…
A: Here we have a code written in C++ programing language. Inside the main block, we have used rand()…
Q: Given a code snippet in C++, write the equivalent codes in MIPS. Note: You may use any register that…
A: The answer is given below.
Q: Please do it with regular expression. Don't use loops please. Do fast, I have no time left Write a…
A: //java code given below:
Q: For the network given in Figure 3.54, give global distance-vector tables like those of Tables 3.10…
A:
Q: c) Assuming an 8-bit system is used (i.e. the system uses 8 bits to represent an integer): (i) (ii)…
A: This question comes from Number System which is a paper of Computer Science. Let's discuss it in the…
Q: Give some details of how you might augment the sliding window protocol with flow control by having…
A:
Q: When closing a TCP connection, why is the two-segment-lifetime timeout not necessary on the…
A: When closing a TCP connection, why is the two-segment-lifetime timeout not necessary on the…
Q: Write a C++ program to generate a random vehicle registration number that is a string of length 10…
A: The question is to solve C++ code for the given problem.
Q: Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3, and no out-of-order…
A: ANSWER:-
Q: Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3, and no out-of-order…
A: The question has been answered in step2
Q: for a switching network. Calculate the total data times needed when the following switching techn…
A: The answer is
Q: Make a superclass called Language,then a child class called Node to extend it. Create a method…
A: Make a superclass called Language,then a child class called Node to extend it. Create a method…
Q: 1 3 5 7 8 10 11 12 13 → Show the result of accessing keys 3, 9, 1, 5 in order in the splay tree.…
A: We need to perform the search operation on each node. Move the particular node to root node: 1)…
Q: Wages are paid at a standard hourly rate for 40 hours per week and at time and one half for…
A: The Java code is given below :-import java.util.*; public class Main{ public static void…
Q: I need help in this C program. Assume two lists of integers both in ascending order. The first list…
A: Assume two lists of integers both in ascending order. The first list was stored in binary files…
Q: What is needed to build a database in the physical world? Make a list o applications out there. If…
A: A database is a software that manages data in an organized manner. A database is used when a huge…
Q: I am having an error in the following java method. pipeline <- javaMethod('createCoreNLP',…
A: Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jdk-18.0.1.1')library(rJava) library(coreNLP)options(…
Q: F=ab+abc+b'c'+a'b'c' Simplify above Boolean function algebraically
A: Provided function is: F = ab + abc + b'c' + a'b'c'
Q: When it comes to cloud security, what is the "shared responsibility" paradigm like?
A: Introduction: One type of cloud security model is the shared accountability paradigm. In order to…
Q: Explain the concept of online payment in brief.
A: Online payments are payments that take place over internet on behalf of goods and services that are…
Q: I need help in this C program. Assume a list of integers stored in a text file named…
A: ALGORITHM:- 1. Declare a file and insert the integer elements in it. 2. Read the integers from the…
Q: Write a C++ program with the following specifications: a. Define a C++ function (name it function…
A: #include <iostream> using namespace std; // the required functiondouble function_StudentID(int…
Step by step
Solved in 2 steps
- public class Cat { private int age; public Cat (int a) { age = а; } public int getAge() { return a; } } Which of the following best explains why the getAge method will NOT work as intended? The instance variable age should be returned instead of a, which is local to the constructor. The variable age is not declared inside the getAge method. The getAge method should be declared as private. The getAge method should have at least one parameter.2. Complete the application below. public class CarApp { public static void main() { string color = blue; string model = C2021;i int speed 80; %3D // declare necessary object matching to the constructor definition // display the color and model on the screen // call the calspeed) method and display the new speed after calculation. } }Describe the classes, methods and attributes that you would use in the Object Oriented design of a simulated automobile. Use this format to describe your classes: Class: Door Methods: void Open(), void Close(), void SetLock(bool), bool GetLocked(), etc. Attributes: bool open, bool locked, class Window, etc.
- Design a LandTract class that has two fields (i.e. instance variables): one for the tract’s length(a double), and one for the width (a double). The class should have: a constructor that accepts arguments for the two fields a method that returns the tract’s area(i.e. length * width) an equals method that accepts a LandTract object as an argument. If the argument object holds the same data (i.e. length and width) as the calling object, this method should return true. Otherwise, it should return false. a toString method (that returns a String representation of the tract’s length, width, and area). Demonstrate the class in a program by creating an array of three LandTract objects initialized with user input. Then, print the info of the LandTract objects stored in the array by invoking the toString method (implicitly or explicity). Also, use the equals method to compare at least two LandTract objects and print wether they are of equal size or not. Sample Output:…Consider the following class definition. public class Gadget { private static int status = 0; public Gadget () { status - 10; public static void setstatus (int s) { status The following code segment appears in a method in a class other than Gadget. Gadget a = new Gadget () ; Gadget.setstatus(3); Gadget b = new Gadget () ; Which of the following best describes the behavior of the code segment? a. The code segment does not compile because the setstatus method should be called on an object of the class Gadget, not on the class itself. b. The code segment creates two Gadget objects a and b. The class Gadget's static variable status is set to 10, then to 3, and then back to 10. c. The code segment creates two Gadget objects a and b. After executing the code segment, the object a has a status value of 3 and the object b has a status value of 3. d. The code segment creates two Gadget objects a and b. After executing the code segment, the object a has a status value of 3 and the object b has a…Create an Employee Class that will have ● Two instance variable: name and workingPeriod ● A class method named employeeByJoiningYear(): o To create an Employee object by joining year for calculating the working period o It will have two Parameter name and year ● A static method experienceCheck() to check if an Employee is experienced or not o It will take working period and gender as parameter o If an employee’s working period is less than 3, he or she is not experienced [You are not allowed to change the code below] # Write your code here employee1 = Employee('Dororo', 3) employee2 = Employee.employeeByJoiningYear('Harry', 2016) print(employee1.workingPeriod) print(employee2.workingPeriod) print(employee1.name) print(employee2.name) print(Employee.experienceCheck(2, "male")) print(Employee.experienceCheck(3, "female")) Output 3 5 Dororo Harry He is not experienced She is experienced
- Create an Employee Class that will have Two instance variable: name and workingPeriod A class method named employeeByJoiningYear(): • To create an Employee object by joining year for calculating the working period o it will have two Parameter name and year • A static method experienceCheck() to check if an Employee is experienced or not o It will take working period and gender as parameter o If an employee's working period is less than 3, he or she is not experienced [You are not allowed to change the code below] # Write your code here employee1 = Employee('Dororo', 3) employee2 = Employee.employeeByJoiningYear('Harry', 2016) 6 print(employee1.workingPeriod) print(employee2.workingPeriod) print(employee1.name) print(employee2.name) print(Employee.experienceCheck(2, "male")) print(Employee.experienceCheck(3, "female")) Оutput 3 Dororo Harry He is not experienced She is experienced8. OOPS Theory #6 public class Car { public void horn() { System.out.println("Horn horn"); } } public class Ferrari extends Car { public void horn() { System.out.println("Ferarriiiiii"); } } public static void main(String[] args) { Ferrari ferrari = new Car(); ferrari.horn(); } Pick ONE option Horn horn Ferarriiii Cannot compile Runtime exception Clear Selection 9. OOPS Theory #7 In Java, we can achieve the abstraction by creating the blueprint of an object and only have abstract methods. What do we call this? Pick ONE option Interface Encapsulation Instance Protected Clear Selectionpublic class Artwork { // TODO: Declare private fields - title, yearCreated // TODO: Declare private field artist of type Artist // TODO: Define default constructor // TODO: Define get methods: getTitle(), getYearCreated() // TODO: Define second constructor to initialize // private fields (title, yearCreated, artist) // TODO: Define printInfo() method // Call the printInfo() method in Artist.java to print an artist's information }} public class ArtworkLabel { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); String userTitle, userArtistName; int yearCreated, userBirthYear, userDeathYear; userArtistName = scnr.nextLine(); userBirthYear = scnr.nextInt(); scnr.nextLine(); userDeathYear = scnr.nextInt(); scnr.nextLine(); userTitle = scnr.nextLine(); yearCreated =…
- Java Object Oriented Programming Create a Shape class that shall have color and filled instance variables of enum Color and boolean type. The filled boolean variable shall show, whether the shape is filled (colored). The enum Color shall be defined within the class having 4 color names (choose any four). Also define getArea and getPerimeter method in Shape class, both shall return 0. Create Rectangle class with length and width attributes and a Circle class with radius attribute, of type double. Properly encapsulate all fields. Circle and Rectangle shall extend Shape class and override getArea and getPerimters methods as per its type and specific formula. In Test class, create an object of Rectangle and Circle, by initializing all attributes in constructor and print both shapes' area and perimters. In Test class, define a static method with following signature, public static void printEachShapeCount(Shape... shapes) As you know, the parent type variable can hold the…In Java Programming, 2 class needs a no-arg constructor and a constructor that initializes all fields with data (The ProductionWorker class constructor should receive data for the Employee class fields as well). I need help to create a method within the Employee and ProductionWorker classes called displayInfo. (displayInfo accepts no arguments and returns void). To display the data for each constructor, the demonstration class will call the subclass displayInfo method and it will call the superclass displayInfo method. User input is not required for the demonstration class. Have a class named "Employee" with the following fields: - Employee Name - Employee Number in format XXX-L, X = digit w/ range 0-9 & L = letter w/ range A-M. - Hire Date Then one or more constructors and the appropriate accessor and mutator methods for the class. Also, another class named "ProductionWorker" that extends "Employee" class. The "ProductionWorker" class should have the following fields to hold…Java - Constructors Create a class named Book that has the following attributes: Publisher - String Year Published - Integer Price - Double Title - String Create a constructor for the class Book that has the parameters from the attributes of the class. After, create a method for the class that displays all attributes. Ask the user for inputs for the attributes and use the constructor to create the object. Lastly, print the values of the attributes. Inputs 1. Publisher 2. Year Published 3. Price 4. Book Title XYZ Publishing 2020 1000.00 How to Win? Sample Output Published: ABC Publishing Year Published: 2022 Price: 150.00 Book Title: Stooping too low Stooping too low is published by ABC Publishing on 2022. It sells at the price of Php150.00.