5. Given the definitions of class x (Figure 3) and class Y (Figure 4) below, class x { private int d: public x(int c) { 7 public int f(){ 10 int a - d + 1; 11 return a; 12 Figure 3 class Y extends private int public Y(int s, t) { int super (s): g - t: 10 O public int h() { 11 int a: 12 a = g-1; 13 return a: 14 15 Figure 4 34
Q: Suppose that you have formatted your disk with a block size of 1024 bytes and assume that we have…
A: The Answer start from step-2.
Q: The management oł Gople plansto invest in new cquipment for the poadiction of teblet computens .…
A: Making an investment decision: Capital budgeting is the word used to describe investment choices. It…
Q: Computer science What is the menu's content? Explain how task-related menus are organised in…
A: Introduction: Menu Menus are useful for providing clues to the concept. It is nicely built around…
Q: What exactly do you mean by "OS for resource-constrained devices"? Briefly describe it.
A: Introduction: Using restricted processing and storage resources, resource constrained devices are…
Q: Describe what a database management system is and what characteristics it has.
A: Introduction: A database management system (DBMS) is another name for a database management system.
Q: Provide me with the MATLAB code to swap the first and last row of the matrix given below, mat = 1111…
A: Swap the first and last row of the matrix
Q: The question is, how do you keep class fields safe from unintentional modification?
A: Answer :
Q: 4. Recall the logic gates pvq png Inverter OR gate AND gate Given the following logic circuit
A: Propositional Logic: It is ways by which the statements can interact with the each other and it is…
Q: How and why is a data model employed in the creation of a database
A: Given: We have to discuss How and why is a data model employed in the creation of a database.
Q: The average running time of the worst case is determined using amortised analysis. True False
A: Introduction: Amortized-Analysis is used to describe algorithms in which one or more operations are…
Q: To class Tree, add the following method public int countOdds(){ return countOddNodes(root); } Write…
A: Solution Code: public int countNodes (Node<E> root) { / / Base cases. if (root…
Q: What is the value of JFK for the conversion below to be correct? (0100111JFK00)2 = (4FC)16 %3D
A: Converting Hex to binary 4 --> 0100 F --> 1111 C --> 1100
Q: A double is a data type in C language that stores high-precision floating-point data. Select one:…
A: True Explanation:- Double stores high precision floating point data in double we can store upto 64…
Q: Write a C program that prints the following output: AND COMMENT EVERY STEP PLEASE 6 7 8…
A: 1. declare the variable i and j for iterartion i is used for inner loop and j is used for outer…
Q: Design a Graphical application using Java FX that connects to Twitter API.
A: class API { // connect to API publicstaticvoidmain(String[] args) { // api url Stringurl =…
Q: Public Key cryptography was created to overcome two major concerns, one of which being key…
A: Introduction: Public Key cryptography was created to overcome two major concerns, one of which being…
Q: What is the function of a real-world parameter?
A: The actual parameter is the value that the caller passes into the method. They are frequently…
Q: Create table "STUDENT" with attributes "STUDENT_ID", "STUDENT_NAME", "STUDENT GPA". Use appropriate…
A: NOTE : There is a policy from bartleby to solve only first 3 subparts of a question.
Q: Use Rice's Theorem to prove that it is undecidable whether, for any positive integer constant k, a…
A: Let language L accept TM M I.e. <M> belongs to L if <M> accepts exactly k strings. So…
Q: Write a program that first gets a list of integers from input. The input begins with an integer…
A: def ints_less_than_or_equal_to_threshold(user_values, upper_threshold): new_array = [] for…
Q: Q2) Consider the regular expression: (ablac)* a. Use Thompson's construction to construct a NFA. b.…
A: The Answer start from step-2.
Q: For simplicity, let us assume that each instruction on a RISC processor is executed in 2…
A: Introduction: Interrupt handling in a RISC processor: Interrupts are a technique for preventing the…
Q: When it comes to computerized systems, what are the most significant functions that they should be…
A: Computerized Systems and Their Functions: Diverse performance-related aspects impact a computer…
Q: b. SELECT EmpName, Sal, Job FROM WORKERS WHERE EmpName LIKE ‘_a’ AND Sal > 10000; JUST ANSWER…
A: The underscore operator i.e. (_) along with sql LIKE operator represents one character in the…
Q: NOTE: (what your answer will contain) 1. Use C PROGRAMMING LANGUAGE ONLY 2. Use RECURSION type of…
A: Here I have defined a recursive function named division(). In this function, I have used a condition…
Q: When you invoke a method on an object instance, the version of the method that will be executed will…
A: True
Q: What are the many types of networking?
A: Introduction What are the many types of networking?
Q: What are the required technologies (hardware and software) that must be deployed in a customer…
A: Introduction: Processor: Processor: Processor: Processor: Processor: Processor: Processor: Processor…
Q: o what extent does an agile approach alter the regular lifecycle of a system?
A: Many organisations are using the agile approach for software development in the recent times.
Q: The term "LAN" stands for "local area network."
A: A local area network (LAN) is a connected environment covering one or more buildings – typically…
Q: What methods can be used to impsove information poivacy
A: The answer is as follows:
Q: What does privacy mean in the context of information security? Information technology
A: Introduction: The term "security" refers to the protection of data, whereas "privacy" refers to the…
Q: D020 0 70 44 2025 3012 60432 8O 24 r 3024 sairi lked la ked for 9.1ADS E 192.143hourN 0100
A: I have written the code below:
Q: What exactly are system development methods? Examine the significance of system development…
A: Introduction: The system development methods: these are the fundamental methods that are used to…
Q: let consider 5 different outputs in combinational circuit/ Digital Logic Design For example x=1 y=…
A: We need to design a single output schema which take the 5 different outputs into a single 5 bit…
Q: Discuss, with necessary diagrams and mathematical analysis, the electrostatic deflection as occur in…
A:
Q: What message authentication options are available? Information technology
A: Introduction: To establish communications, MACs, authenticated encryption, and digital signatures…
Q: In order for a software to make use of a file, it must perform three stages.
A: Files in a programming languageThe file permanently keeps data in a storage device or system's hard…
Q: what is the definition of an incident and what needs to have occured in order for a security event…
A: Question: what is the definition of an incident and what needs to have occurred in order for a…
Q: Consider the following graph and find the minimum cost of this problem by using Prim's algorithm and…
A:
Q: Explain the concept of a digital signature and how it is created.
A: Introduction: A digital signature, which is a sort of electronic signature, is a mathematical…
Q: The usage of social media as a communication tool is on the rise in today's culture. In terms of…
A: Social media is a term used to describe the collection of applications and websites which allow…
Q: What does SQL's Like operator do?
A: When a value is compared to other similar matters, the SQL LIKE clause employs wildcard operators to…
Q: Write the compound proposition (¬p) → (q v (r ^ ¬s)) a. Postfix notation b. Prefix notation C. Infix…
A: The solution for the above-given question is given below:
Q: ode in Prolog. Do not use in built libraries. Implement the following relation to get a vector…
A: Input : Two vectors. Output : Element wise product of two vectors.
Q: Complete a program in a class ToyCounter that computes the cost of toys sold in a shop. Five kinds…
A: Program for create toyCounter and compute the total cost
Q: What exactly is Open Database Connectivity (ODbc)?
A: Introduction: Open Database Connectivity (ODBC) is a database access interface that is defined by…
Q: What exactly is an open environment?
A: Introduction: An open environment is a system that provides for the free flow of information and…
Q: Identify 5 current security architecture and design risks. Then: a) Describe each danger.
A: Malware: In order to steal or exchange information from you, a cybercriminal might pose as a…
Q: There are three types of page layouts in CSS, and you can describe them.
A: We'll review some of the CSS layout aspects discussed in earlier units, such as various display…
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:
Step by step
Solved in 2 steps
- A is its parent class, while B and C are its subclasses. B and C share several features and techniques, but they implement them differently. Apply reasoning to determine A's type.write a phyton code: 1- define a class CommissionEmployee that:a. has a firstName, lastName, socialSecurityNumber, grossSales and commissionRateinstance variablesb. does initialize its properties to the values given at the time of instantiation withdefault valuesc. does provide a string representation when we call print on it2- define a class BaseCommissionEmployee, that is a CommissionEmployee anda. has a " baseSalary " property that tells us the base salary per weekb. does initialize its properties, inherited from CommissionEmployee class and definedin BaseCommissionEmployee, to the values given at the time of instantiation.c. has a method earnings that calculates and returns commission employee's pay(baseSalary + ( commissionRate * grossSales ))d. does provide a string representation when we call print on it3- define a class CommissionTester thata. has a method "main" to test the CommissionEmployee and BaseCommissionEmployeeclassesb. the main method must instantiate the class into…create a uml class diagram on this code: from abc import ABC, abstractmethod class GreyAnatomy(ABC):@abstractmethoddef Tvshow(self):pass class Grey(GreyAnatomy):def Tvshow(self):print("I am Derek") class Rank(Grey):def Tvshow(self):print("I am an attending") class Specialty(Rank):def Tvshow(self):print("I am an neurosurgeon doctor") G = Grey()G.Tvshow() R = Rank()R.Tvshow() S = Specialty()S.Tvshow()
- Class A is the parent class, while classes B and C are the subclasses of A. Both B and C contain several features and techniques that are equivalent to one another; nevertheless, the implementations of some of their methods are quite different between the two. Explain what kind of class A will be using logic, whether it be a concrete class, an abstract class, or an interface.Design and implement Java program as follows:(1) There will be a Gift class with following attributes: id (combination of numbers and letters),size (values S, M, or L), and price(2) There will be two child classes FruitBasket and SweetsBasket with the following additionalattributes: FruitBasket: number of fruits, include citrus fruits indication (true or false) SweetsBasket: include nuts indication (true or false)(3) The Gift class hierarchy must provide the following Functionality: On creation, a gift instance must be given all attribute values except price which must becalculated and number of fruits which must be set by system All attribute values can be changed after creation except id and the values that arecalculated or set by the system Price is calculated as follows:o There is a flat fee of 19.99 for S gift, 29.99 for M gift, and 39.99 for L gift.o Fruit basket gift has additional fee of 5.99 when it has citrus fruits. Number of fruits in a basket is as follows: Small…Computer Science Create an inheritance hierarchy of Rodent: Mouse, Gerbil, Hamster, etc. In the base class, provide methods that are common to all Rodents, and redefine these in the derived classes to perform different behaviors depending on the specific type of Rodent. Create an array of pointers to Rodent, fill it with different specific types of Rodents, and call your base-class methods to see what happens. Write a small program to show the difference between calling a virtual function inside a normal member function and calling a virtual function inside a constructor. The program should prove that the two calls produce different results.
- Example Code Ch 09-4Given the following partial class definition:public class A1{public int x;private int y;protected int z;...}public class A2 extends A1{protected int a;private int b;...}public class A3 extends A2{private int q;...} 1. Refer to Example Code Ch 09-4: Which of the following is true with respect to A1, A2, and A3?a. A1 is a subclass of A2 and A2 is a subclass of A3b. A3 is a subclass of A2 and A2 is a subclass of A1c. A1 and A2 are both subclasses of A3d. A2 and A3 are both subclasses of A1e. A1, A2 and A3 are all subclasses of the class ALab 8.1 Declare Card subclasses Consider using the following Card class. public class Card{ private String name; public Card() { name = ""; } public Card(String n) { name = n; } public String getName() { return name; } public boolean isExpired() { return false; } public String format() { return "Card holder: " + name; }} Use this class as a superclass to implement a hierarchy of related classes:Write declarations for each of the subclasses. For each subclass, supply private instance variables. Leave the bodies of the constructors and the format methods blank for now. Class Data IDCard ID number CallingCard Card number, PIN DriverLicesnse Expirationyear Important: DriverLicense is subclass of IDCard class Lab 8.2 Provide constructors for Card subclasses Implement constructors for each of the three subclasses. Each constructor should call the superclass constructor to set the name. Here is one example: public…Implement all these classes while illustrating the concept of aggregation and composition in terms of ownership and life-cycle. Consider six classes i.e. Person, Department, Laboratory, and University having following specifications. Class University has Two attributes of type string i.e. universityName and location· An attribute named dept of type Department Class Department has Two attributes i.e. deptID, deptName· A two-argument constructor to initialize data fields with user-defined values· A member function display() to show all attribute values Class Laboratory contains Two attributes i.e. labID and experimentNo· A two-argument constructor to initialize data member with user-defined values Class Person has Two attributes i.e. name and age· A parameterized constructor to initialize attributes with user-defined values· A member function display() to show its attribute values
- We discussed in the class that during the design, you may need a class that serves as an interface for its derived classes, but you would not create any instance of that class. Such a class is called an abstract class. The UML class diagram shown below shows a class hierarchy starting from the Vehicle class which is an abstract class. Write a program to implement this class hierarchy such that the given code in the main function runs without error. Vehicle Bus Car Truck IntraCityBus InterCityBus int main() { Vehicle* V[] = { new Bus, new Car, new Truck, new IntraCityBus, new InterCityBus }; for (int i = 0; i < 5; i++) { cout<< V[i]->move() <<endl; } return 0; } Your program should produce an output as the following: Bus: Moves to carry a large number of people Car: Moves to carry a small number of people Truck: Moves to transport goods Intra-City Bus: Intra-City Bus: Moves to carry a large number of people between two areas of a city Inter-City Bus:…75. The fact that the same operation may apply to two or more classes is called what? a. Inheritance b. Polymorphism c. Encapsulation d. Multiple classificationClass A is the parent class, while classes B and C are the subclasses of A. Both B and C contain several features and techniques that are equivalent to one another; nevertheless, the implementations of some of their methods are quite different between the two. Explain what kind of class A will be using logic; is it going to be a concrete class, an abstract class, or an interface?