Demonstrate how the Java operator instanceof tests to verify if an object is an instance of another class or not. You will create 3 classes, the main, a simple class and another that is a child of the simple. Type up the code and submit the results.
Q: What are a genetic programming system's three main evolutionary operators?
A: In this question we need to explain three main evolutionary operators of genetic programming system…
Q: a. In your own words, describe a scenario that exemplifies the unethical conduct of an IT employee…
A: Introduction: IT industry stands for Information Technology industry and is a broad category of…
Q: Hello, I need help with a database question table 1 deciration_id type total_income table 2…
A: - We have to work on the SQL queries asked on the tables. - Since there are more than three…
Q: The C program shown below is compiled and run on a UNIX machine. Predict all possible outputs that…
A: For the given C program, we need to predict all the possible outputs when this program is compiled…
Q: Where do online and telephone networks differ most from face-to-face interactions?
A: The answer is given in the below step
Q: This page describes in great detail how the telephone network, the oldest and most well-known type…
A: A wired network is more secure than a wireless one. The likelihood of communication signals being…
Q: Question 1)SELECT ALL THAT APPLY In multimodal biometrics, which of the following are valid levels…
A: Biometrics is the use of physiological or behavioral characteristics to identify individuals.…
Q: How does secret-key cryptography really work, and what is it? Please include any background…
A: The single key that is required to encrypt and decode communications in this kind of cryptography…
Q: Exactly what does it entail when information is compromised? What did occur, and how did it occur?…
A: In this question we need to explain what does it mean when someone say information is compromised.…
Q: Dout Co (a) Consider a concurrent system with three processes P1, P2 and P3. //Process P1 void…
A: Concurrency which refers to the one it is needed to facilitate multiple processes/applications being…
Q: Switches, routers, and cabling are "building blocks" of data transmission networks; thus, how should…
A: Switches, routers, and cabling are critical components of data transmission networks and should be…
Q: Suppose your youngster uses the school's wireless LAN to access to the internet and inputs…
A: Introduction: LAN is a set of linked devices in a building, company, or household. A LAN may range…
Q: How do you evaluate the effectiveness of the fundamental operations inside the supply chain?
A: Supply chain management covers supply planning, product planning, demand planning, sales and…
Q: What type of hacker do you think concerns corporations the most, and why? What type of hacker do you…
A: Let us see the answer What type of hacker do you think concerns corporations the most, and why? Blue…
Q: (c) What are the physical memory addresses for each of the following logical addresses for the…
A: Below is the complete solution with explanation in detail for the given question about calculating…
Q: Implement the STAQUE abstract data type, a linked stack and linked queue together. Create methods…
A: Depending on whether the STAQUE is considered as a stack or queue, the method PUSHINS inserts one…
Q: PLEASE ANSWER ASAP! I really need help. Essay: Choose from below suggested topics and expound. 1.…
A: Sure, I'd be discuss on the topics Robots that are capable of having emotions The idea of…
Q: When shopping for hardware, what are the top three factors to consider
A: Hardware refers to the physical components of a computer or other piece of electronic equipment.…
Q: Can we trust digital signatures as much as we would a traditional one? A brief clarification is…
A: A digital signature is an electronic form of a handwritten signature that is used to sign…
Q: Why wasn't Target staffed with a chief information security officer (CISO) at the time of the data…
A: According to the information given:- We have to define why wasn't Target staffed with a chief…
Q: . With the provided table below, write a C++ program that asks user to input stock symbol, checks…
A: Interpolation which refers to the one it is a method of deriving a simple function from the given…
Q: "choose a number at random"?
A: According to the question, we have explain random, and how to choose a number at random. In step 2,…
Q: The recurrence equation is T(n) = T(n-5)+ sqrt(n) then the time is Select one: O a. O(n¹.5) Ob. O(n)…
A: Here is the solution of the problem. see below steps.
Q: I was wondering if you had any opinions on the recent changes Google made to its search algorithms.
A: INTRODUCTION: The Google search engine likes websites that are linked to a lot of other websites.…
Q: The Mobile Switching Center (MSC) is responsible for what in GSM
A: A Mobile Switching Center (MSC) is a central office used in a cellular telephone network to…
Q: What are the most significant distinctions between computer/telephone networks and other types of…
A: The use of a telephone allows two or more people to communicate when they are too far away to hear…
Q: The fundamental way of controlling processes in Linux is by sending signals to them. There are…
A: The solution is an given below :
Q: Give a brief summary of the three major file organization techniques.
A: Introduction: The term "file organization" refers to the logical connections between the different…
Q: What kind of data did Facebook and Cambridge Analytica leak?
A: A breach of data A data breach is a situation in which information is taken from a system without…
Q: Imagine a simple database storing information for students' grades. Design what this database might…
A: In a simplistic database, you could have at least these three objects: Students, Courses, and…
Q: Suppose three algorithms A, B, and C, can be implemented to perform a task. The algorithms have the…
A: To rank the algorithms from least time-complex to most-time complex, we need to consider the time…
Q: Assume the base address of an integer array A of words in register $7, Write MIPS instructions set…
A: Here is the mips instruction set of the above problem. See below steps for the instructions.
Q: Create a program that converts the given number in the binary system to the decimal system . A…
A: Answer is
Q: For want of a better expression, what is CPP?
A: CPP:- cross-platform language that can be used to create high-performance applications. C++ was…
Q: $d = Group delay 2-1²-1 Ar-22+1 Plot the group delay for a range of 20 values in 0 < < 1 [Implement…
A: Here is the python code.
Q: Observe the following two Sequential Search and Binary Search algorithms in the image. Perform a…
A: Search Algorithms which refers to the one it is search algorithms are algorithms that are used to…
Q: Java: User enter 20 strings, any string start with "b" or "B" should be printed on the screen
A: Algorithm for the code: 1.Start 2. Create a Scanner object for user input 3. Create an array of…
Q: Is there a way to pin down what a digital signature really is, and how it operates in the real…
A: Intro Digital signatures are digital "fingerprints" that securely: connect a signer to a document…
Q: This qu
A: Dear Student, The answer to your question is given below -
Q: Suppose three algorithms A, B, and C, can be implemented to perform a task. The algorithms have the…
A: We need to rank the given algorithms with respect to time complexity.
Q: 1. A router receives a packet with destination address (222.186.114.16) Show how it finds the…
A: Please refer to the following step for the complete solution to the problem above.
Q: Which of the following choices, you will need to analyze in order to get the SSID of a certain…
A: We need to analyze to get ssid of certain point.
Q: Where do you start looking, how much should you budget, and what are the three most crucial factors…
A: Hardware: The term "hardware" refers to the physical component or device of a system that is…
Q: Code in C++ code that would instruct an LED to shine at 1/4 the brightness compared to a regular…
A: - We have to write Arduino code in C++ to let the LED shine at 1/4 the brightness of regular high…
Q: 11.3: What are the advantages of the variant of linked allocation that uses a FAT to chain together…
A: To find advantages of the variant of linked allocation that uses a FAT to chain together the blocks…
Q: 11.8: Consider a file system that uses inodes to represent files. Disk blocks are 8KB in size, and a…
A: The given information is, Disk size = 8KB Pointer size = 4 byte
Q: Name John Fetzer Johnny Fetzer Which of the following choices is a field? Name John Fetzer 07-2332…
A: The database is a collection of numerous tables. It is the responsibility of the database…
Q: FIN bits in the TCP header are used for connection termination. True O False
A: Here is the explanation:
Q: What does the MAC extension mean?
A: Answer:
Q: Hello, I need help with a data base question Create a database named bicycles with the two…
A: Below is the complete solution with explanation in detail for the given question in SQL Database…
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Demonstrate how the Java operator instanceof tests to verify if an object is an instance of another class or not. You will create 3 classes, the main, a simple class and another that is a child of the simple. Type up the code and submit the results.
Step by step
Solved in 3 steps
- Course Title: Modern Programming Language Please Java Language Code and Correct Code Please Question : Design an abstract class GeometricObject. GeometricObject must ensure that its children must implement calcArea() method. Design Rectangle18ARID2891 and CircleMJibranAkram Classes as children of GeometricObject class with overridden toString() method to return “Rectangle18ARID2891 with w Width and h Height is drawn” OR “CircleMJibranAkram with r Radius is drawn”. The attributes of Rectangle18ARID2891 are length, width. The attribute of CircleMJibranAkram is radius Hint: Area of circle=πr2 , Area of rectangle= width*lengthConsider the following class definitions public class SampleClass{ public String greet() {return "Greetings";} } public class SubClass extends SampleClass{ public string greet() {return "Hello";} } public class AnotherClass{ public String greet() {return "Hi";} } What can be said about the following code fragment? public class Driver { public static void main(String[] args){ Object p =new SampleClass(); System.out.println((AnotherClass).p),greet()); } } a. The above code compiles but causes runtime error. b. The above code has no issues. It compiles and runs. c. The above code causes compiler error.language: Java Class Inheritance with an abstract class Define a class Employee with the following fields: _name, _empId, _department, _position (_title), _yearlySalary, _fullTime (a boolean: true/false) , _month , _year (time of hire) Add constructor and properties Define an abstract method GetBiMonthlySalary() (if the employee is paid twice a month) Define an abstract method GetVacationTime() that returns the number of vacation time this employee would have based on time of hire Override the ToString() method to return a string that contains the information pertaining to an employee such as name, empId, department, and where full time or not. Define a class HourlyEmployee that inherits from Employee. This class should have 2 fields of its own: _hours (hours worked in half a month) and _wage (hourly wage) Provide necessary constructor, properties and methods Override the ToString() to also return the additional fields Gets 3 days of vacation after first year if the…
- Java Programming Create "Mammal" class as a parent class and "cat" as a child class Mammal(Superclass) Attributes name Methods move() eat() cat (Subclass) Attributes age Methods dispaly() eat() Override eat method in cat subclass. Print something in methods such as in move method you can print “I can move”. Test the inheritance with creating objects and calling parent and child methods. Create object of a child class by passing arguments to the constructor.public class Father { public String name; public int age; // customer name Father(){ name=”Hassan”; age=50;} public void display(){ System.out.println(“Name:”+name); System.out.println(“Age:”+age); } } 1. Based on Figure 3, create a class named Child that inherits the Father class. Declare an instance name location (String) for class Child. 2. Define a constructor in class Child and give an appropriate initial values for the instance (name, age, location). 3. Define a method display () in class Child, execute the display ( ) method in superclass using the keyword super. Method display ( ) in class Child should print the information of name, age and location 4. Create other class named Main for the main method and create 2 objects for the 2 classes (Father and Child). Then execute the display ( ) method for Father and Child. Example of the output as in Figure 4: Father's info: Name: Josh Age: 50 Child's info: Name: Christy Age: 20 Location:…JAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…
- Go off this code: public abstract class Employee{private String firstName;private String lastName;private String SSN;double salary; public Employee( String first, String last, String ssn ){firstName = first;lastName = last;SSN = ssn;} public void setfirstName( String first ){firstName = first; // should validate} public String getfirstName(){return firstName;} public void setlastName( String last ){lastName = last; // should validate} public String getlastName(){return lastName;} public void setSSN( String ssn ){this.SSN = ssn;}public String getSSN(){return SSN;} @Overridepublic String toString(){return String.format( "%-12s%-12s%-12s", getfirstName(), getlastName(), getSSN() );}public abstract double earnings();}Course Title: Modern Programming Language Please Java Language Code Question : Design an abstract class GeometricObject. GeometricObject must ensure that its children must implement calcArea() method. Design Rectangle18-ARID-2891 and CircleM.JibranAkram Classes as children of GeometricObject class with overridden toString() method to return “Rectangle with w Width and h Height is drawn” OR “Circle with r Radius is drawn”. The attributes of Rectangle are length, width. The attribute of Circle is radius Hint: Area of circle=πr2 , Area of rectangle= width*lengthHow to fix these erros LocalResource.java:153: error: LocalResource is not abstract and does not override abstract method getPay() in Person public class LocalResource extends Person { ^ LocalResource.java:160: error: incompatible types: String cannot be converted to int super(firstName, lastName, date); public class LocalResource extends Person { private static int idCounter = 0; private int id; private String sector; private String trn; public LocalResource(String firstName, String lastName, String trn, String date, String sector){ super(firstName, lastName, date); this.trn = trn; this.sector = sector; this.id = ++idCounter;} public String getSector() { return sector; } public void setSector(String sector) { this.sector = sector; } public int getId(){ return id; } public String getTRN(){ return Integer.toString(id +100000000); } public String getContact() { return "LocalResource#" +…
- (Java) Make the 2 following classes: Employee.java EmployeeTest.java Copy and paste the below starter code into Employee.java: /** * Employee.java extends Person.java * @author * CIS 36B, Activity 11.1 */public class Employee extends Person { private static int numEmployees = 0; private double salary; private String title; /** * Default constructor for the * Employee class. Calls the * default constructor of the * superclass and also initializes * salary and title to default * values */ public Employee() { } /** * Multi-argument constructor for the * Employee class. Calls the * multi-argument constructor of the * superclass and also initializes * salary and title to the * specified values */ public Employee(String name, int age, String gender, Address a, double salary, String title) { } /** * Returns the annual salary * @return the salary */ public double…**Students.java code** // A Java program to demonstrate use of Comparableimport java.util.*; // A class 'Student' that implements Comparableclass Student implements Comparable<Student>{ private String FirstName; private String LastName; private int StudentID; // Used to sort movies by year public int compareTo(Student a) { return this.StudentID - a.StudentID; } // Constructor public Student(String fm, String ls, int id) { this.FirstName = fm; this.LastName = ls; this.StudentID = id; } // Getter methods for accessing private data public String getFirstName() { return FirstName; } public String getLastName() { return LastName; } public int getStudentID() { return StudentID; }} // Driver classclass Students{ public static void main(String[] args) { ArrayList<Student> list = new ArrayList<Student>(); list.add(new Student("Amir", "Alao", 123456)); list.add(new…public class OfferedCourse extends Course { // TODO: Declare private fields // TODO: Define mutator methods - // setInstructorName(), setLocation(), setClassTime() // TODO: Define accessor methods - // getInstructorName(), getLocation(), getClassTime() } import java.util.Scanner; public class CourseInformation { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); Course myCourse = new Course(); OfferedCourse myOfferedCourse = new OfferedCourse(); String courseNumber, courseTitle; String oCourseNumber, oCourseTitle, instructorName, location, classTime; courseNumber = scnr.nextLine(); courseTitle = scnr.nextLine(); oCourseNumber = scnr.nextLine(); oCourseTitle = scnr.nextLine(); instructorName = scnr.nextLine(); location = scnr.nextLine(); classTime = scnr.nextLine(); myCourse.setCourseNumber(courseNumber); myCourse.setCourseTitle(courseTitle);…