public abstract class Plant { } public abstract void breathe (); Consider the class shown above. Which of the following class definitions will NOT compile? public class Flower extends Plant { public void water() { System.out.println("Fresh water"); } } public class Flower extends Plant { public void breathe () { System.out.println("Fresh air"); } } public abstract class Flower extends Plant { public abstract void water(); }
Q: Adjacency matrix of undirected graph is given. Count the number of hanging vertices in it. The…
A: //note: since the programming language is not specified we are providing answer in cpp #include…
Q: Provide two benefits of implementing virtualization on a network as a networking technology.
A: The answer is provided below.
Q: What precisely does "wireless security" mean?
A: Wireless security provides the security to the network by using the wireless connection. It prevents…
Q: Describe the kind of firewall software that is installed on a Windows Server operating system.
A: A firewall is a network security architecture that filters and regulates incoming and active network…
Q: Complete the following exercise: Alter your student table adding a new column called enroll_date…
A: Alter your student table adding a new column called enroll_date using the datetime data type.…
Q: What are the two different types of file access that are available worldwide? Exactly how do these…
A: Please find the answer below :
Q: Suppose G = (V, E) is a simple, connected graph with |VI = 5, select all the possible value for deg…
A: We can find all the possible values using the formula, n(n-1) / 2 here n=5
Q: Explain how the principles underlying agile methods lead to the accelerated development and…
A:
Q: Match the literals to their respective data types:
A: There are different data types in programming language:- Integer Character String float Long…
Q: One feature of the existing DNS .com hierarchy is that it is extremely wide. (a) Propose a more…
A: The answer for the above question is given in the below steps for your reference
Q: x86 Assembly Language Programming What will be the final value in EDX after this code executes? mov…
A: The answer is
Q: I suggested in Section 29.1 that the objects manipulated by users should be drawn from their domain…
A: A warehouse assistant using an automated parts catalogue In this case, the domain of the objects…
Q: Find out how to configure an HTTP server so as to eliminate the 404 not found message and have a…
A:
Q: Consider the following edge-weighted graph G with 9 vertices and 16 edges: 90 Q6.1 Kruskal 0 40 50…
A: A minimum spanning tree is a tree that has minimum lengths or weights on its edges hence forming a…
Q: An IS system allows you to input information about the products in which you are interested, the…
A: GUI is also known as graphical user interface.
Q: When a program is run in a text-based environment, such a command line interface, it is unclear what…
A: The end user or the software developer:- The orders establish the sequence in which the events are…
Q: Which command is used to list the contents of the current working directory including the hidden…
A: Hidden File in Linux: The easiest way to show hidden files on Linux is to use the ls command with…
Q: Do parallel/distributed databases have a distinct advantage over centralized ones?
A: 1. Centralized Database : A centralized database is basically a type of database that is stored,…
Q: Who or what determines what happens when someone uses a text-based environment, such as the command…
A: Introduction In this question we are asked Who or what determines, what happens when someone used a…
Q: How can all of the worksheets in a workbook have the same page layout applied at once?
A: please find the answer in next step
Q: Q. Which is used to iterate the values in Hashtable?
A: There are multiple methods to iterate values in Hashtable in JAVA Five methods are given below with…
Q: What distinguishes a data warehouse from a database?
A: Introduction: Data is information that has been transformed into a form that is efficient for…
Q: Character P is encoded as 1010000 in a computer. Usually, a parity bit will be sent together with a…
A: Given: A character P is encoded with 101000. In this question, we are asked to find the odd parity…
Q: list and describe data center components.
A: A data centre is an office that gives shared admittance to applications and information utilizing a…
Q: What, in general terms, is the distinction between computer organization and puter architecture?
A:
Q: Suppose host A reaches host B via routers R1 and R2: A-R1-R2-B. Fast retransmit is not used, and A…
A:
Q: What kinds of analyses are possible with NLOGIT software?
A: NLOGIT Software is a plece of software that was developed by NLOGIT.
Q: 5. For the 8-bit word 11010001, calculate the check bits to be stored with it. Suppose when the word…
A: The above question is solved in step 2 :-
Q: What are the four main components of any general-purpose computer?
A: Introduction: The CPU, or Central Processing Unit, is the "brain" of the computer. Using numerous…
Q: ++, write a function Circle::intersect(Circle c) where class is defined below, for the funtion it…
A: Please find the answer below :
Q: Each time slot contains 148 bits. Just 114 of these 148 bits reflect speech or other i for a number…
A: The answer is
Q: Simplify the recurrence relation and find the value of f(23) f(n)=2f(n-1) + f(n − 2) + f(n-3)+...+…
A: I have provided the answer based on C++ Programming. Detailed comments are included for a better…
Q: You may choose between the command-line interface and the graphical user interface (GUI). Why?
A: Given: You may choose between the command-line interface and the graphical user interface (GUI).…
Q: Discuss the differences between the candidate keys and the primary key of a relation. Explain what…
A: A primary key refers to a fixed of diverse attributes (or a single attribute) that assist in…
Q: write a java code to get the current gain in the common base configuration after taking collector…
A: Take the string from the user using the scanner class object and iterate a loop over the string and…
Q: As presented in the text, SMTP involves the exchange of several small messages. In most cases, the…
A: PART A EHLO, MAIL FROM, RCPT TO, and DATA instructions need the client to pay attention to the…
Q: A binary symmetric channel has a chance p = 0.002 of incorrectly transmitting a single bit. Let w…
A: The answer is
Q: You may use the code syntax a(n) to save a value in a control's property.
A: Introduction: The term "syntax" refers to the rules that govern the meanings of the many possible…
Q: What are the four main components of any general-purpose computer?
A: The general purpose computer is the one that ,given the appropriate application and the required…
Q: A control's property governs whether or not it is shown on the form during runtime, much like with…
A: Attribute Control : Attribute Control Charts are a gathering of control diagrams expressly made for…
Q: What are the four main components of any general-purpose computer?
A: The answer of the question is given below.
Q: escribe the kind of firewall software that is installed on a Windows Server operating system.
A: This topic pertains to installing firewall software on a Windows Server operating system.
Q: enumerate the advantages of adopting virtual memory.
A: Virtual memory: is a storage mechanism offers an illusion of having a very big main memory. It can…
Q: In Hashtable methods are synchronized or not?
A: Hashtable is a Data structure used in programming language.
Q: Like other controls, a control's property determines whether or not it is shown on the form during…
A: The Control class provides the essential capabilities for showing important data in styles. The…
Q: Write a java code for finding the probability of doing anything from the user entered probability of…
A: import java.util.Random;import java.util.Scanner; public class Main { public static void…
Q: Compare and contrast the purpose of data mining and predictive analytics. Provide a practical…
A: Data mining The process of evaluating data from various angles and distilling it into valuable…
Q: Q. Which is used to iterate the values in Hashmap?
A: This question is asking for iteration of values in hashmap.
Q: What a class contains in java?
A: Question is asking for contains of a class in java language.
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:
2-19
Which of the following will not compile.
Step by step
Solved in 2 steps
- Draw the UML diagram of the following class: public class Employee { String name; double salary; public Employee() { } public double getSalary() { return this.salary; } public String getName() { return this.name; } }Java program: The class diagram with four classes Mammal, Human, Student and Doctor is given. The Mammal class is given as well. Write down the remaining classes as described in the class diagram. The fields and methods for each class is given in the attachment. //in Mammel.java Public interface Mammal{ public double hairColor(): } 1. Class Human: Fields: age(int), weight(double), height(double) Methods: getAge, getWeight, getHeight 2. Class Student: Fields: major (String), gpa (double), creditHours (int) methods: getMajor: returns major, getGpa: returns gpa, getYear: returns freshman, sophmore, junior, senior as determined by earned credit hours Freshman : less than 32 credit hours sophmore: at least 32 but less than 64 credit hours junior: at least 64 credit hours but less than 96 credit hours senior: at least 96 credit hours 3.Class Doctor: Fields: years(int), Speciality (String) methods: getYears: returns years, getSpeciality: returns speciality, getSalary: calculates…Complete the partial declaration of Class Car: public class Car { // declare three private instance variables: color, speed, model // define a constructor with two parameters: c , m which will assign values to color and model. //define set and get method for all instance variables //define a method named calspeed( ) with int return type, the method will increase the speed by 50 mile per hour. } Complete the application below. public class CarApp { public static void main() { string color = blue; string model = C2021;i int speed = 80; // 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. } }
- 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…True or False ___(1) An abstract class can have fields. ___(2) You can create an object from an abstract class _ _(3) An abstract class can have both abstract methods and methods that have method bodyClass Inheritance with 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 employee works…
- The Essay class has a default constructor, a constructor with two parameters, and a constructor with three parameters. Declare the following objects: essay1 with no arguments essay2 with essayTitle and essayAuthor as arguments essay3 with essayTitle, essayAuthor, and essayYear as arguments Ex: If the input is Painting Cole 1919, then the output is: Essay: Undefined, Unspecified, 0 Essay: Painting, Cole, 0 Essay: Painting, Cole, 1919 Archive.java public class Archive { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); StringessayTitle; StringessayAuthor; intessayYear; essayTitle=scnr.next(); essayAuthor=scnr.next(); essayYear=scnr.nextInt(); /* Your code goes here */ essay1.print(); essay2.print(); essay3.print(); } } Essay.java public class Essay { private String title; private String author; private int year; public Essay() { // Default constructor title = "Undefined"; author = "Unspecified"; year = 0; }…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*lengthIn java Create an abstract super class called Employee with the following attributes: name : String and the following methods getter and setter for the one attribute three constructors an abstract method called getSalary() equals() toString() Create a sub class of Employee called Faculty with the following attribute yearlyPay : double department: String and the following methods getter and setter for the attributes three constructors getSalary() that returns the yearlyPay divided by 52 equals() toString() Create a sub class of Employee called Staff with the following attributes: hoursWorked : double payrate : double and the following methods getters and setters for the two attributes three constructors getSalary() that returns the weekly pay (multiply hoursWorked by payrate, overtime included and 1.5 times payrate for hours > 40) equals() toString() Create a sub class of Employee called Sales with the following attributes: salesAmount : double //sales per week…
- Let’s build a Player Portfolio System that has an abstract class. Create a new Player Abstract class. Implement getName method in this abstract class. Define other methods as abstract. Here is an example: abstract class PlayerA {private String name;public String getNameA(){return name;}public PlayerA(String name) {this.name = name;}abstract public int getStatsA();abstract public String getSportA();} Create NFL Player and NBA Player concrete classes that will extend Player abstract class. Create a main method to implement your classesCreate an interface Wheel with methods setWheels (int c) and getWheels () and a class Vehicle with abstract methods getColor () and getBrand (). Now, create a concrete class Taxi with additional method setDriver (String name) that inherits both Wheel and Vehicle. (Note: Concrete classes don’t have any abstract method)Write the classes as shown in the following class diagram. Add a tester that asks the user for a cat, dog and a BigDog then call all of their methods. Note that Cat and Dog inherit from the abstract class Animal and BigDog inherits from Dog.