ClassA + retrace(): void 1 <> Retraceable + retrace(): void 1 ClassB + retrace(): void
Q: Write a program that reads a text file in which each line in the file consists of a first name, a…
A: #include <iostream> #include <fstream> #include <string> using namespace std;…
Q: What is the signal to send through the medium if the sequence of bits to carry is 1110010101
A: Manchester encoding is a method of encoding digital data in which the data bit to be transmitted is…
Q: The given program reads a list of single-word first names and ages (ending with -1), and outputs…
A: Here is the the program regarding the incremented age.
Q: Make a document detailing the various DNS records, labeling each one with the sort of record it…
A: A mail exchanger (MX) record refers to a domain's mail server, referred to as the mail server.…
Q: Question 6. (a) Construct a minimum spanning tree of the graph in Figure 1 using Kruskal algorithm.…
A: Introduction Minimum Spanning Tree: A spanning tree of a connected, undirected graph is a subgraph…
Q: Request iteration in DNS, the difference between authoritative and root servers, and the format of…
A: Introduction: Iterated and non-iterated requests, authoritative and root servers, and DNS records…
Q: Do you know what a "poison packet assault" is or how to defend against one? Give some instances to…
A: Introduction: Local Area Network (LAN) ARP Poisoning is a kind of cyberattack that involves…
Q: Algorithm 1: Question 2.1 1 numbers [1,2,3,4,5); 2 stack-new Stack(); 3 queue = new Queue(); 4…
A: Required: Algorithm 1: Question 2.1 number = [1, 2, 3, 4, 5]; stack = new Stack(); queue = new…
Q: 7.10: Tic Tac Toe (sort of) Write a program that will allow two users to play tic-tac-toe. The…
A: The correct answer for the above mentioned question is given in the following steps for your…
Q: Our method will involve analyzing a string and picking the 5 most common letters in that string. We…
A: Define find_common_letters() function to find the five most common letters in a string. Define…
Q: C++ Define an "Expression" class that manages expression info: operand1 (integer), operand2…
A: C++ defines classes and objects. It is more powerful than procedural-oriented programming. C++…
Q: #include int check (int x[], int n, int i); #define SIZE 10 int main() { int a [SIZE] = {2,4,7,5,…
A: a) OUTPUT : 10 3 6 8 5 11 4
Q: s of a progra
A: At the point when a program is fabricated, the compiler makes executable documents for that program.…
Q: Request iteration in DNS, the difference between authoritative and root servers, and the format of…
A: Introduction: Iterated and non-iterated requests, authoritative and root servers, and DNS records…
Q: Selecting the best programming language is a time-consuming procedure.
A: A programming language is nothing more than the collection of guidelines that are followed while…
Q: Naming the various parts of a high-level programming language allows for their easy identification.
A: Introduction Naming the various parts of a high-level programming language allows for their easy…
Q: Write a section of Python code (not an entire function) that adds up the even numbers from 2 through…
A: Step-1: Start Step-2: declare variable x and assign value 2Step-3: declare variable total and assign…
Q: The alphabet of the language is (a, b, c): Use pumping lemma to prove that the language (abc n>0} is…
A: Given grammar:
Q: Isn't this a normal binary tree and not an ordered? Could an ordered one be provided?
A: In this question we have to get the ordered tree Let's implement
Q: When several instructions must be processed by a single CPU, how can we minimize the time spent…
A: When several instructions must be processed by a single CPU, we can minimise the time spent by using…
Q: ectory on a UNIX system, only if the file name (not including the extension) begins and ends with a…
A: Dear Student, The answer to your question is given below -
Q: Explain how object-oriented and procedural programming languages vary from one another in terms of…
A: Answer is given below
Q: IN PYTHON Please answer the problem below. Also, please explain the purpose of any code written in…
A: Python is an object-oriented and structured programming language. Python is easy to learn, and it is…
Q: Why do you think x86 will not let you run the instruction below : mov [r8], [rax]
A: Assembly language: Assembly language is a low level programming language. It is used to tell…
Q: By using Java, Give implementation of binary search tree (BST) using array, that displays the…
A: A binary search tree which refers to the one it is a rooted binary tree in which the nodes are…
Q: Please code in MASM 7. Prime Number Program Write a procedure named IsPrime that sets the Zero…
A: MASM which refers to the one it is Microsoft Macro Assembler (MASM) provides several advantages over…
Q: Write a function that takes as input a positive integer and returns true if it is prime and false…
A: 1) Below is C++ Program that write a function that takes as input a positive integer and returns…
Q: The amount of potential pipeline failures may be reduced with the help of compilers and assemblers,…
A: A pipeline executes many instructions concurrently.A pipeline processor consists of linear sections…
Q: s. While watching television you might have experienced blurring and flickering of the image that…
A: Smart TVs require regular over-the-air updates. In some cases, your TV screen might flicker due to…
Q: write socket to connect between cerver and client by using C or python to calculate area of…
A: The solution is done using Python programming. Please refer to the following step for the complete…
Q: CHALLENGE 6.11.5: Modify a vector parameter. ACTIVITY Write a function SwapVector Ends() that swaps…
A: Solution: A function SwapVectorEnds() that swaps the first and last elements of its vector…
Q: What is RAM?
A: Random access memory is volatile. This means that data is stored in RAM while the computer is on,…
Q: Alternatively, it has been suggested to construct a processor that may decrypt encrypted data and…
A: When a computer shuts down, the CPU executes instructions in order. The CPU follows the instruction…
Q: lease draw the Olympic Rings. You can output many stars (*) to form a rings, but the parameter of…
A: In this question we have to draw Olympic Rings using C++without using graphics and just using stars…
Q: As a university network administrator, you are responsible for deciding on an appropriate NAT…
A: A network administrator is the person in a company who is in charge of running computer networks,…
Q: I want to write a python project asking the user to do house chores.
A: Solution #House Chore App #Welcome to your House Chore App! print("Welcome to your House Chore…
Q: Explain in great detail what makes object-oriented and procedural languages different.
A: The Procedure Programming Language places more emphasis on procedures. Object-Oriented Programming…
Q: Explain in your own words what happens during a DNS reverse search. Where does DNS fit into the…
A: In computer networks, a reverse DNS lookup or reverse DNS goal (DNS) asks the Domain Name System…
Q: How do database rows break up the information they contain?
A: The following examples illustrate how data is stored in a row in a table in a database: The majority…
Q: What is the difference between greedy algorithm and optimal solution. List at least three pros and…
A: Here is the difference between the greedy algorithm and the optimal solution: Greedy algorithm: A…
Q: Follow up question 1.please convert the above code into Class Using object-oriented approach. 2.…
A: In this question we have to convert the previous code into OOPS based code using classes approach…
Q: ANDROID Your project must have at least one _____. manifest string TextView…
A: A TextView is used to displays text to the user and optionally allows them to edit it. An activity…
Q: 3. Write c++ expressions for the following algebraic expressions: (Note: to use a pow function for…
A: Disclaimer: As per our policy, "Since you have asked the multiple questions, we will solve the first…
Q: A pangram is a word or a sentence that contain every letter of the alphabet. For example, the most…
A: Dear Student, The source code, implementation and expected output of your code is given below -
Q: Define a function Coord Transform() that transforms the function's first two input parameters xVal…
A: Call By Reference: By the method of call by reference the function copies the reference of an…
Q: Write Algorithm to Conversion from an Arabic number to a modern Roman number. in: decimal number n…
A:
Q: What can we deduced in the following circumstances? Louie and Val were the last persons to leave the…
A: - This is related to the physical security of a system.
Q: Given a sentence, write a function that counts its number of words.
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT--------------
Q: What are the many steps involved in the programming process? What factors should be thought about…
A: Programming Programming is the most common way of making a bunch of instructions that advise a…
Q: This makes it more probable that applications written for 0-, 1-, and 2-address architectures will…
A: Lessons are longer (more number of instrcutions). Solution: Let's compare the number of operands per…
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
- Task: Implement a class ChessPiece with properties: color, isAlive, moveCount, and position (x, y coordinates). Define an abstract move method. Create a Tower subclass that overrides move for specific behavior. Instructions: ChessPiece Class: Properties: String color, boolean isAlive, int moveCount, Position position. Abstract Method: move(int x, int y). Position Class: Contains int x, int y. Tower Subclass: Extends ChessPiece. Overrides move for straight line movement. Deliverable: Source code for ChessPiece, Position, and Tower. Document class functionalities briefly.Create 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)Implement a JAVA application that keeps track of package deliveries to consumers. Theapplication consists of the following classes:• Item: Create a class called Item. The class has two member variables oftype String named name and description and provides getter and settermethods for both.• Mail (abstract class): Implement an abstract class called Mail . The class hasa member variable of type String named address and a getter method for it.• Letter: Implement a class called Letter that inherits from Mail . The classhas one member variable of type String named contents.• Package: Implement a class called Package that inherits from Mail . Theclass has one member variable of type Item[] named items and a gettermethod for it.• DeliveryTruck: Implement a class called DeliveryTruck with a singlemember variable of type Mail[] of length 10. Add the following method:o void load(Mail mail): This method stores the given mail argumentat the next available spot in the member variable.
- Consider the following UML diagram. Suppose that each of these classes has a getMass () method that returns the mass of the current object (double); that the Star class has a getPlanets () method that returns an array of Planet objects (the planets that orbit this planet); and that the Planet class has a getMoons () method that returns an array of Moon objects (the moons if this planet). All attributes of these classes are private. All methods described above are public. Star 0.. Planet Create a class called SolarMass that has a single class method in it called solarMass (Star theStar) that returns the total mass of the input star (along with the mass of all of that star's planets and their moons). The method returns a double. Any program should be able to call this method. e..* Moonsolve this by arraylist in the last of the question it has been told Create abstract class Pet , which is the abstract superclass of all animals. Declare a integer attribute called legs, which records the number of legs for this animal. Define a constructor that initializes the legs attribute. Declare an abstract method eat. Declare a concrete method walk that prints out something about how the animals walks (include the number of legs). Create the Dog class. The Dog class extends the Pet class. This class must include a String attribute to store the name and food of the pet Define a default constructor that calls the superclass constructor to specify that all dogs have 4 legs and name. override the eat and walk method. Create the Cat class that extends Pet. This class must include a String attribute to store the name of the pet, and a string to save food . Define a constructor that takes one String parameter that specifies the cat's name and food. This constructor must also…Instructions: Write your answer on a piece of paper with your name on top. Take a picture and submit within the allocated time limit. Problem 1: Implement class Employee as illustrated below. Apply appropriate constructors, encapsulate, and override toString and equals. Student Course Problem 2: «interface Payable abstract Employee Person SalariedEmployee Idno Name Employee Superclass Department Salary Subclass getPayment Amount() firstName, lastName, SSN weeklysalary Given the class hierarchy: 1. Define the interface Payable. 2. Define the class Employee that implements Payable and encapsulate. 3. Define SalariedEmployee and encapsulate. Implement getPayment Amount(). getPayment Amount() - returns a double amount that must be paid for an object of any class that implements the interface. For SalariedEmployee, it would just return the value returned by getWeeklySalary(). for new files: 128MB
- a:) Define a Polygon interface that has methods area() and perimeter(). b:) Then implement classes for Triangle, Quadrilateral, Pentagon, Hexagon, and Octagon, which implement this interface, with the obvious meanings for the area() and perimeter() methods. c:) Implement classes, IsoscelesTriangle, Equilateral-Triangle, Rectangle, and Square, which have the appropriate inheritance relationships. d:) Write a simple user interface, which allows users to create polygons of the various types, input their geometric dimensions, and then output their area and perimeter. e:) For extra effort, allow users to input polygons by specifying their vertex coordinates and be able to test if two such polygons are similar. using all a to e parts develop a program-Interface IResearch Scholar has two methods public void teaches (String str) and public void studies (String str). - Define classes JuniorRS and SeniorRs such that JuniorRS implements IResearchScholar and SeniorRS extends JuniorRS. - Class InterAbstrTest extends SeniorRS, and has the main method. An object of JuniorRs invokes the method studies, and an object of SeniorRS invokes methods studies and teaches.Abstract classes and interfaces can both be used to specify common behavior of objects.How do you decide whether to use an interface or an abstract class? Explain youranswer.
- import bridges.base.ColorGrid;import bridges.base.Color;public abstract class Mark {// this is protected (rather than private) so that// subclasses of Mark can access itprotected Color color;/*Returns true if and only if the given Coloris the same as this Mark's Color. Two Colorsare considered the same if their Red, Green,Blue, and Alpha components are equal.c: the Color to check against*/public boolean isColor(Color c) {return false;}/*Draws this Mark onto the given ColorGridcg: the ColorGrid to draw onto*/public abstract void draw(ColorGrid cg);} import bridges.base.Color;import org.junit.Assert;import org.junit.Test;public class MarkTest {private static final Color B = new Color("black");private static final Color W = new Color("white");private static final Color U = new Color("blue");@Testpublic void isColorTest() {Mark m1 = new Point(0, 0, W);Mark m2 = new HorizontalLine(1, 1, 2,…Explain the difference between the following implementations of class A.a. extending class A from class Bb. extending class A from parent abstract class Cc. class A implementing interface DPurposeTo review abstract classes and polymorphismDirectionsThe total cost of a group of items at a grocery store is based on the sum of the individual product prices and the tax (which is 5.75%). Products that are considered “necessities” are not taxed, whereas products that are considered “luxuries” are. For this practice problem you will need to download Shopping Trip Starting Code.zip from Pilot.The Product class is abstract, and it has a method called getTotalPrice. Your task is to create two subclasses of Product: NecessaryProduct and LuxuryProduct and implement the getTotalPrice method in each of these classes appropriately. Then modify the driver program to instantiate four…