Q1) Define the class point2D(x,y) for the x, y coordinates. The class has x, y and color as member variables and as member function has setXY(x1,y1), setColor(pColor), MoveRel(Dx,Dy), getX(), getY), getColor(pColor), Print(), the constructers point2D(), point2D(x1,y1,pColor), the destructor -point2D(). The MoveRel(Dx, Dy) function changed the x, y coordinates by the amount of Dx, and Dy, respectively (ex: X=X+Dx, y=Dy+Dy). Determine which function is accessor and which one is mutator. Your answer
Q: Q2- Write a program to create a vector matrix A(10) from input. Then print only the numbers that…
A: ALGORITHM:- 1. Declare a vector. 2. Take input for 10 elements from the user. 3. Print the elements…
Q: By defining a dynamic allocation for pointer array, ask the user to enter some numbers and then…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: When it comes to cryptography, what is the difference between symmetric and asymmetric?
A: Introduction: Data is encrypted using symmetric encryption methods. Data is decrypted using…
Q: Create a program that can read scores data from the keyboard in five games interactively and please…
A: In this program we have to write a code, In which programming language is not defined so, we will…
Q: Subject - Machine Learning What is Lexicon-based / attention neural networks based approach model…
A:
Q: Caches are important because of how they deal with the problem. Do you have any problems with them?…
A: Introduction: Why not create a cache the size of the device it's caching for (for example, a cache…
Q: So, what exactly is a distributed denial of service assault, and how can a single person carry one…
A: Answer :
Q: Describe the steps involved in the processes of authentication, authorisation, recording, and…
A: INTRODUCTION: Authentication, Authorization, Accounting, and Auditing are all introduced in this…
Q: if(adultRB.isSelected() = = true) decBaseFee decADULT FEE; here what is isSelected?
A: if(adultRB.is selected() == true) decBaseFee = decADULT_FEE; here what is isselected ? a) class b)…
Q: Does it make you feel more comfortable identifying someone based on their fingerprints, their voice…
A: Introduction: The term "biometrics" refers to the process of calculating or measuring something.…
Q: Task 5 Create an Employee Class that will have Two instance variable: name and workingPeriod A class…
A: Step-1: Start Step-2: Create a class Employee class Employee: Step-2.1: Create two instance…
Q: Virtual memory isn't used in embedded systems as much as it should be.
A: Introduction: Virtual memory is a piece of volatile memory formed on the storage device for a short…
Q: Take a look at the advantages and disadvantages of open-source systems.
A: Below the advantages and disadvantages of open-source operating systems.
Q: What are the two most compelling arguments in favor of using layering protocols? Give specific…
A: Introduction: Someone or something that is exceptionally beautiful or fascinating is described as…
Q: Write a Student class to get the desired output as shown below. 1. Create a Student class and a…
A: As the programming language is not mentioned as per our policy i am solving using the python…
Q: What would happen if you set reboot.target or runlevel 6 the default runleveltarget for your system?
A: Let us see the details below,
Q: Which log in Event Viewer would you use to track down atten logins, if you had to?
A: Which log in Event Viewer would you use to track down attempted computer login if you had to
Q: Consider the differences between physical and schematic models and illustrate your points with…
A: Introduction: In order to prove your argument or make it more understandable, you might use an…
Q: What do you understand by the term ‘Data Modeling’? Computer science
A: Answer: Data Modeling is an arrangement where you can build an apparent description of each and…
Q: How do you think the most effective firewall management techniques are developed, in your opinion?…
A: Introduction: A network firewall is a critical piece of security equipment, and it should be as…
Q: Which log in Event Viewer would you use to track down attempted computer logins, if you had to?
A: Introduction: Expand Windows Logs and choose Security from the drop-down menu. Now check for event…
Q: When it comes to modifying the RFI route, what alternatives do you have?
A: Introduction: Some background information about your organisation (to provide context to potential…
Q: How important is cpu? (100 to 150 words)
A: CPU The CPU is the most important component in a computer is because without it you would not be…
Q: What are the methods for exchanging information under a company's information security incident…
A: Introduction: Information security refers to the methods and methodologies used to secure…
Q: Given the ER diagram above, answer the following questions: Name an entity type that has more than…
A: a)Department is an example of entity having more than one relation. b)Departmentname is a key…
Q: I'm not sure what the point of routing is or how it works. Separate and contrast the differences…
A: Answer :
Q: Provide the missing code segment in the portion with the TO DO remark in the following sample code.…
A: To complete the function compare present in the Dictionary class.
Q: Define the characteristics that are required for test-driven development. In the event that you…
A: Introduction: TDD is a technique of the software development in which test cases are written to…
Q: A computer with a limited number of instructions has a "reduced" instruction set, but what exactly…
A: Introduction: When compared to CISC CPUs, which require hundreds of cycles to perform a full…
Q: You sometimes see numeric intervals given as 2 < x < 3 In C this interval does not have the meaning…
A: 2<x<3 is a combination of two statements x>2 and x<3 which means x lies between 2 and 3…
Q: Do you agree that "Network address translation is meant to save IPv4 address space"? Why do you…
A: Introduction: Network address translation (NAT) is a technique for translating one IP address space…
Q: Which search engines are legal and ethical in their operations?
A: Introduction: When we compare Ecosia to Google, we can see that Ecosia has a far better ethical…
Q: Task 8: Write and execute the command to retrieve the average square footage and average monthly…
A: Since table name is not mentioned, I am using table name as "PROPERTY" Query: SELECT AVG(SQR_FT),…
Q: The role of a firewall and how it might be implemented in your organization are discussed here.
A: Answer is given below .
Q: Determine the output embedded by correct syntax.
A: The output will be 9
Q: The star topology is a network configuration in which each node is linked to a central hub, switch,…
A: Star topology is one of the most famous topology among LANs ( local area network).
Q: Explain how a cloud storage program varies from traditional client storage software in terms of…
A: Introduction: Traditional storage is a kind of storage in which data is stored on local physical…
Q: The National Security Agency (NSA) is in need of a program that will store a message, encrypt the…
A: In this code we are asked to write a C++ program to encrypt and decrypt a string by using hash…
Q: hat exactly is the difference between the Screen and Overlay blending modes in Photoshop?
A: Blending Modes in Photoshop: It comes in early 1994 as the first layer of photoshop and there are…
Q: Which network topologies do you believe are conceivable, and which ones do you advocate as being the…
A: Topology network : A Mesh Topology network has many interconnections, making it the most practical…
Q: Question: Input an expression containing opening and closing parenthesis. Write a C program to check…
A: In the given question opening and closing parentheses are used to represent the mathematical…
Q: Given input {71, 22, 21, 99, 53, 69, 39} and a hash function h(x) = x mod 10, show the resulting:…
A: h(x) = x mod 10. This says, there are 10 locations in hashtable starting from index 0 to 9. It is…
Q: What is the operation of an overlay network? Is a router included in the price of the package? What…
A: Introduction: In an overlay network, routers and the edges of the overlay network are all…
Q: 20 7 15 10 12 27 30 10 22 25 12 15 17 What will the tree look like after we delete 25?
A: Given tree is B+ tree which is a type of tree data structures. In this tree, all the data values are…
Q: I'm not sure what the Cybercrime Conceptual Framework is, or how it works. You should add references…
A: Introduction: Cyberspace, according to the internet theorists, allows for near-instant connections…
Q: library system that includes 1.serach a book. 2.add new book. 3.remove a book. 4.print book…
A: def Menu(): print("Library Management System") print("-"*30) print("-"*30) print('''…
Q: When it comes to relational databases, what are the consequences of present database technologies?
A: As the computing and processing power of the processors is increasing day by day on the other hand…
Q: How can I move between users without having to log out of my account?
A: Introduction: When you delete an account, it is deleted from all of the device's applications. You…
Q: 1- Add a function (copyArray) to copy the elements of the array list into a new array newList with a…
A: 1 - Add a function (copyArray) to copy the elements of the array list into a new array newList with…
Q: What will the final values of count1 and count2 be in terms of n? assume that n is a power of 2 of…
A: Answer the above program are as follows:
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 4 steps with 1 images
- Implement a nested class composition relationship between any two class types from the following list: Advisor Вook Classroom Department Friend Grade School Student Teacher Tutor Write all necessary code for both classes to demonstrate a nested composition relationship including the following: a. one encapsulated data member for each class b. inline default constructor using constructor delegation for each class c. inline one-parameter constructor for each class d. inline accessors for all data members e. inline mutators for all data membersin c++ write aprogram to Create a class Rectangle with length and breadth as private data members and also provide the following member functions: getdata(): gets the length and breadth of rectangle. calarea(): return the area of the rectangle. calperi(): return the perimeter of the rectangle. issquare(): return true if the rectangle is squareDesign a struct personalinfo with components id, and name of type string. Design a class student with private data member's person (struct variable of type personalInfo), number Of Courses (of type integer), average (of type float), and marks[] an array of student's marks of type integer. The class also has the member functions ser( ), getPerson(), print(), findAverage(), getAverage(), and a parameterized constructor with default value 1 for the number of courses. Implement the member functions of the class student. The member function findAverage() is used to calculate the average mark for each student. I Write a driver that does the following: Declares the array section[ ] of objects of student type. Reads the number of students. Reads information for each student from the file student.txt. Calls the user-defined function int maxAverageIndex(int, student []) Prints the id and name of the student with the maximum average. Student.txt: 4 1463491 Ali 72 65 81 85 1370005 Yousef 5 91 82…
- Design a class named LinearEquation for a 2-by-2 system of linear equations:ax + by = e x=(ed-bf)/(ad-bc)cx + dy = f y=(af-ec)/(ad-bc)The class contains:• Private double data fields a, b, c, d, e, and f.• A constructor with the arguments for a, b, c, d, e, and f.• Six getter methods for a, b, c, d, e, and f.• Methods getX() and getY() that return the solution for the equation.• A method named isSolvable() that returns true if ad - bc is not 0. The method isSolvable() willbe called in the main, if it returns true display the calculated values for x and y by calling getX()and getY(). If the call to isSolvable() returns false, display a message that “the equation has nosolution”.Write a test Java program that prompts the user to enter a, b, c, d, e, and f and displays the result. After the valuesfor a through f are entered, create a LinearEquation object. Check to seeIf ad - bc is 0, report that “The equation has no solution”, otherwise print out the values for x and y.write a class Point with parametrized constructor. This class have four member variables, a,b,c,d. Write the following member functions a. drawTriangle(int x, int y, int z ) b. drawRectangle(int x, int y, int z, int a). Each function should display the length of lines for each of the shape (triangle, rectangle). For example triangle should calculate length of its three lines by following methods as shown in code. Note: the number of lines depends on the name of shape. void drawTriangle(int x, int y, int z ) { int line 1 = x - y; // convert to positive value if line length is negative int line 2 = y -z; int line 3 = z -x; cout<< The length of each lines is: << //// here display length of each line with proper formatting. } Write similar code for drawRectangle(int x, int y, int z, int a). Wtite main function to call these three functionConsider the following definition of a class.class displayClass{public: void print(); ... private: int listLength; int *list; double salary;string name; } Part a. Write the function prototype to overload the assignment operator for the class displayClass. Part b.Write the definition of the function to overload the assignment operator for the class displayClass. Part c. Write the function prototype to include the copy constructor for the class displayClass. Part d. Write the definition of the copy constructor for the class displayClass.
- -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.objective of the project: Implement a class address. An address has a house number street optional apartment number city state postal code. All member variables should be private and the member functions should be public. Implement two constructors: one with an apartment number one without an appartment number. Implement a print function that prints the address with the street on one line and the city, state, and postal code on the next line. Implement a member function comesBefore that tests whether one address comes before another when the addresses are compared by postal code. Returns false if both zipcodes are equal. Use the provided main.cpp to start with. The code creates three instances of the Address class (three objects) to test your class. Each object will utilize a different constructor. You will need to add the class definition and implementation. The comesBefore function assumes one address comes before another based on zip code alone. The test will also return…Define the class Student which has the private members name, department, and mark. It has the public members set(), getMark(), get) (to get the student's name and department), print(), and a default parameterized constructor (with default values "Ali" as a name, "Physics" as a department, and 83 as a mark). Define a class called Section which has the private members title, length, and a pointer p of type Student. It has the public members set), print(), and a default parameterized constructor (with default values "A" as a course title, and 12 students). The class also has a member function average() to find the section average, and a copy constructor. Implement the two classes Student and Section enforcing the least privileged principle. Read the following records fro the file "student.txt". Abass Physics Computer Amal Engineering 87 43 Adel 63 The following driver produces the given sample output: int main() Section abc("Introduction to IT", 3); abc.set("IT"); abc.print(); return 0:…
- Define a class counterType to implement a counter. Your class must have a private data member counter of type int. Define a constructor that accepts a parameter of type int and initializes the counter data member. Add functions to: Set counter to the integer value specified by the user. Initialize counter to 0. Return the value of counter with a function named getCounter. Increment and decrement counter by one. Print the value of counter using the print function. Example output: Counter = 0. The value of counter must be nonnegative.Question: Implement the following UML class diagrams and test their methods. Shape - dimension1 : double - dimension2 : double + Shape(d1: double, d2 : double) + setDimension1(d1: double) : void + setDimension2(d2 : double) : void + getDimension10 : double + getDimension20 : double + getName() : String + getArea) : double + toString() : String Circle Rectangle - circleld : int - circleCounter : int + Circle(radius : double) + setRadius(radius : double) : void + getRadius) : double + getCircleld) : int + getCircleCounter) : int + getName() : String + getArea() : double + toString) : String - rectangleld : int - rectangleCounter : int + Rectangle(side1 : double, side2 : double) + setSide1(side1 : double) : void + getSide10 : double + setSide2(side2 : double) : void + getSide20 : double + getRectangleld0 : int + getRectangleCounter0 : int + getName() : String + getArea() : double + toString) : StringDeclare Snake class with two private data members length and max as integers. Define constructor to initialize1 to length and 50 to max. Also, define grow as a function member to increase the length by 1.