Design a class named Square that defines a square geometric shape. The class needs to have a data member named side that defines the length of each side. Then defined two member functions: getPeri and getArea to find the perimeter and area of the square shape. Now define a Cube that defines a cubic shape and inherits from the Square The class Cube needs no new data members, but it needs the member functions getArea, and getVolume. Provide the appropriate constructors and destructors for both classes.
Q: contrast and distinction Packet-Switched and Dedicated-Circuit Services
A: Intro In Circuit-switched networks, the connection between the source and destination has to be…
Q: Explain the concept of read uncommitted isolation level. Give an example of how it is used.
A: The lowest isolation level is Read Uncommitted. At this level, one transaction may read…
Q: What exactly is the goal of artificial intelligence, and why is its implementation necessary? Please…
A: Introduction: Artificial intelligence (AI) employs machine learning and deep learning approaches to…
Q: Is it possible to use the words World Wide Web and Internet interchangeably?
A: Intro short for World Wide Web: => The internet is a massive network comprised of billions of…
Q: When the size of data is more than the protocol data unit, data is _______ to multiple frames.
A: Explanation: When the size of data is more than the protocol data unit(PDU) then the data is divided…
Q: 1) At the beginning of each week, a machine is either running or broken down. If the machine runs…
A: Dynamic programming is a computer programming technique that efficiently solves a class of…
Q: Because of Facebook's major privacy issue, you have decided to stop using the social media site.…
A: Facebook has faced several security issues. These originate mostly from the organization's revenue…
Q: What options do cloud-based companies have to deal with these issues? The potential risks and…
A: Start: Cloud computing is the delivery of various equipment and programming administrations over the…
Q: Shrek has guessed three positive integers a, b, and c. He keeps these numbers in secret, but he…
A: import java.util.Scanner; public class Input{ protected int num1, num2, num3, num4; //declaring…
Q: Is there a definition of the word "agile" that is generally accepted by everyone?
A: Is there a definition of the word "agile" that is generally accepted by everyone?
Q: What is the purpose of watchdog timers in many embedded systems?
A: Introduction: The significance of a watchdog timer in embedded systems:
Q: Explain the distinction between concurrent and simultaneous transactions. How many CPUs are needed…
A: Difference between concurrent and simultaneous transactions: Concurrent transactions…
Q: Why are so many organizations in such a hurry to set up and develop their intranets quickly across…
A: Introduction: Communication, collaboration, and cooperation with others are the key pillars of…
Q: Cloud computing is becoming a prevalent practice among multinational organizations. However,…
A: Explanation: Within the context of the issue, we will have a conversation on the safety of the…
Q: Enterprise information systems are responsible for gathering data from all parts of a business and…
A: Introduction: For every company to be successful, organizational and financial data must be handled…
Q: What common challenges do businesses often face when attempting to make the switch to a cloud-based…
A: Cloud-based infrastructure has recently gained popularity: The following are some of the obstacles…
Q: What is Linux distribution life-cycle management and what does it do?
A: Other operating systems, such as Microsoft's Windows, combine all the code into one package. One of…
Q: Write a MATLAB function called sumOfElements that takes an array (which contains numbers) as the…
A: code in Matlab along with output and code screenshot
Q: How will the rise of cloud computing effect its members' ability to work together in a more…
A: Cloud collaboration: Cloud collaboration is a sort of team collaboration in which employees…
Q: The last question I have is this: what exactly is the point of artificial intelligence? I would…
A: Create the AI goals by writing: In the early days of computing, researchers developed algorithms…
Q: Which of the following I/O technique is appropriate to use for wireless printer? Select the correct…
A: The answer is given below.
Q: Determine the"FUNCTIONS" and the "APPLICATION IN REAL LIFE" of the following: • Barcode Reader…
A: The answer to the following question:-
Q: What are two common methods for safeguarding a password file? Explain.
A: Introduction: Organizations store passwords in a variety of formats. Csv, xlsx, and txt are…
Q: Discuss the advantages and disadvantages of getting an education online that is supported by…
A: AI aided online learning: Artificial Intelligence (AI) is a field in computer science that involves…
Q: What other types of artificial intelligence are there for users to choose from? Define the several…
A: Introduction: The computer emulation of human intelligence processes is known as artificial…
Q: When attempting to access a resource, a user must supply a mutually agreed factor to the access…
A: When attempting to access a resource, a user must supply a mutually agreed factor to the access…
Q: What is the end goal of artificial intelligence (AI) research and development? Provide a concise…
A: WHAT IS ARTIFICIAL INTELLIGENCE : WHERE DOES ARTIFICIAL INTELLIGENCE COME FROM? Artificial…
Q: Write c program to calculate answer of below expression x²+5x+6 Ask user for value of x…
A: Given: Write c program to calculate answer of below expression x²+5x+6 Ask user for value of x
Q: In what ways has the Internet of Things (IoT) been used in the past?
A: The Internet of Things' History: The internet of things is a concept in which physical items…
Q: There are numerous sectors and organizations that might benefit substantially from the cloud…
A: The most major influence of cloud technology may be in lowering costs and boosting the…
Q: How can I diagnose and solve issues with my network by utilizing the CLI troubleshooting commands…
A: Introduction: Timeouts, heavy buffering, poor internet call quality, and other difficulties are…
Q: What is the history of the internet of things, and what are some examples of how this technology is…
A: The internet of things' history and present applications: To promote RFID technology, the name…
Q: With comments, differentiate between static and non-static objects.
A: If you apply static keyword with any method, it is known as static method. A static method belongs…
Q: Question 1 Using any two categories or types of operating systems, explain using two examples of how…
A: We need to differentiate between operating systems for embedded systems and general systems with…
Q: Write a Python program that will display all prime numbers within a range (Ask the user where to…
A: Here I have created a function named isPrime(), which checks whether the given number is prime or…
Q: Technology based on information What results may be expected in the event that a bug is introduced…
A: Introduction: There are two sorts of mistakes that occur the bulk of the time.
Q: The table below shows the length, width and thickness of a stack of steel plates: Length (ft) Width…
A: ALGORITHM:- 1. Declare and initialise the array with initial values. 2. Print the initial state of…
Q: Explain why legacy systems are important to a business's operations. The study of computers
A: Actually, given question regarding legacy systems.
Q: Please explain in your own words why the main memory on a mobile device is limited, and then compare…
A: Intro Main Memory in Mobile Devices The term "main memory" refers to the location inside mobile…
Q: Which of the following I/O technique is applicable for multiple-word I/O transfer? Select the…
A: Multiple choice questions.
Q: Discuss why software designers should try to promote cohesiveness whenever possible, and how they…
A: Intro Vibrating means how it bounds the modules together Good software design should attempt to…
Q: Penetration testing can only be performed in an isolated setting. There are several benefits to…
A: The significance of doing penetration testing in a secure environment is as follows: Penetration…
Q: Calculate and return the sum of two decimal numbers - getSum. * Your answer Accept an integer,…
A: calculate and return sum of two decimal numbers Python Code: a = int(input("Enter first number:"))b…
Q: How does the department guarantee that users have access to the network when using a system that is…
A: Introduction: To send a single packet over a network, much alone across many networks, an enormous…
Q: What do you think the future holds for artificial intelligence in light of the developments that…
A: Machines can learn from their experiences, adapt to new inputs, and execute human-like jobs because…
Q: Higher education may now be more widely accessible to everyone thanks to a decision made by an IT…
A: Introduction: Higher education may benefit from information technology and IAAS (infrastructure as a…
Q: What kinds of troubleshooting strategies and simple network commands have you utilized in the past…
A: The following is a list of methods for troubleshooting a primary network: Check the settings to see…
Q: Computer science: Discuss the reasons why businesses believe it is important to compare agile and…
A: Inspection: New information suggests that the majority of companies operating in today's market are…
Q: Which code will define the size(number of elements) of an array where the name of the array is arr?…
A: Mcq.
Q: What are the goals of the research that is being done into artificial intelligence? Provide two…
A: 195 AI's Purpose: Artificial intelligence employs technologies such as machine learning and deep…
Design a class named Square that defines a square geometric shape. The class needs to have a data member named side that defines the length of each side. Then defined two member functions: getPeri and getArea to find the perimeter and area of the square shape. Now define a Cube that defines a cubic shape and inherits from the Square The class Cube needs no new data members, but it needs the member functions getArea, and getVolume. Provide the appropriate constructors and destructors for both classes.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- In Chapter 10, the class clockType was designed to implement the time of day in a program. Certain applications, in addition to hours, minutes, and seconds, might require you to store the time zone. Derive the class extclockType from the class clockType by adding a member variable to store the time zone. Add the necessary member functions and constructors to make the class functional. Also, write the definitions of the member functions and the constructors. Finally, write a test program to test your class.Create a base class named Point consisting of x and y data members representing point coordinates. From this class, derive a class named Circle with another data member named radius. For this derived class, the x and y data members represent a circle’s center coordinates. The member functions of the Point class should consist of a constructor, an area() function that returns 0, and a distance() function that returns the distance between two points,(x1,y1) and (x2,y2), where Additionally, the derived class should have a constructor and an override function named area() (PI*pow(radius,2)) that returns a circle’s area. Task: 1-Include the classes constructed in a working C++ program. 2-Have your program call all the member functions in each class. 3- In addition, call the base class’s distance() function with two circle objects and explain the results this function returns.Model a room class, whose member data is three integers length, width and height. The classcontains two constructors to initialize the room class objects, first is no argumentconstructor, while the second in three arguments constructor. Class also contains threemember functions i.e., getdatat) to get the data from user and store in the memory of callingobject and showdata) to show the room data of calling object, int volume(int I, int w, int h)function should receive the length, width and height values from the objects one by one andreturn the volumes of the three objects respectively.Write a main program to declare the three object rl, 12, and 13 of room class. Two objectwill store the values through three argument constructor and third object will get the datafrom user by calling getdata function. Then all three objects should call the volumefunctions to calculate their volumes and store them in three variables of type integer. Finallythe system compare the three volumes values…
- Consider a base class named Employee and its derived classes HourlyEmployee and PermanentEmployee while taking into account the following criteria.• Employee class has two data fields i.e. a name (of type string) and specific empID (of type integer)• Both classes (HourlyEmployee and PermanentEmployee) have an attribute named hourlyIncome• Both classes (HourlyEmployee and PermanentEmployee) have three-argumentconstructor to initialize the hourlyIncome as well as data fields of the base class• Class HourlyEmployee has a function named calculate_the_hourly_income to calculate the income of an employee for the actual number of hours he or she worked. One hour income is Rs. 150 • Similarly, PermanentEmployee class has function named calculate_the_income to calculate the income of an employee that gets paid the salary for exact 240 hours, no matter how many actual hours he or she worked. Again, one hour salary is Rs. 150.Implement all class definitions with their respective constructors to…Q3 Use the concept of polymorphism and classes to represent the following analog A Transportation class has the fields (model, year) with all the setters and getters. An Airplane class inherits Transportation, and it has a field number of wings (no wings) with a setter and a getter. A Car class inherits Transportation, and it has a field number of wheels (no wheels) with a setter and a getter. Al the parent and child classes have toString( ) method that prints everything. In the main program, create an array of transportations of size 6 (3 of them are airplanes and 3 are cars), and put any values you choose in the constructors. Finally run a loop through the array and print all the information, and by using the tool “instance of” if the element is an airplane, print “BINGO..AIRPLANE”, if the element is a car, print “BINGO..CAR”Create a base class Shape with a member function area() that returns 0. Derive two classes Circle and Triangle from the base class. Override the area() function in each derived class to calculate the area of the respective shape. Instantiate objects of both Circle and Triangle classes, and demonstrate the usage of the overridden area() functions.
- Write a class Distance which has two private data members (int feet,float inches). The class has three constructors which are having no parameter - values of both feet and inches are assigned zero. having two numbers as parameters - the two numbers are assigned as feet and inches respectively. having one number as parameter - both feet and inches are assigned that number. Provide getters and setters for data members. Now write a main class which demonstrate the functionality of above class by calling all constructors, setters & getters. Create 1 object using default constructor, and use setters to set values, then getters to print values. Create a second object using constructor having two parameters, provide values, then print values on screen. Create third object by using third constructor having one parameter, after that print values on screen.Create a base class Shape with a member function area() that returns 0. Derive two classes Circle and Triangle from the base class. Override the area() function in each derived class to calculate the area of the respective shape. Instantiate objects of both Circle and Triangle classes, and demonstrate the usage of the overridden area() functions. Expand the Shape hierarchy by adding a new class Square. Override the area() function in the Square class to calculate the area of a square. Create a function named calculateTotalArea() that takes an array of pointers to Shape objects and calculates the total area of all shapes using polymorphism.a.Define the class pointType to implement the properties of a point in a two-dimensional plane. Your class must contain functions to individually set and retrieve the x and y coordinates, find the distance between this point and another point, and constructors to initialize pointType objects. If p1 and p2 are pointType objects, then p1.distance(p2) returns the distance between p1 and p2.b. Write the definitions of the member functions of the class pointType defined in part a.c. If we know two points on a line, we can describe various properties of a line, such as whether the line is vertical, horizontal, or slanted, and if the line is nonvertical, then find its slope. Define the class lineType with two private data members of type pointType to store the coordinates of two points on a line in the two-dimensional plane. Among others, your class must contain functions to determine if the line is vertical, horizontal, or slanted, find the slope of the line, and output the equation of the…
- write the definition of the class Rectangle containing: length: a private data member of type double width: a private data member of type double a default constructor that assigns the values 20 and 10 length and width, respctively. an overloading constructor that accepts two parameters of type double and assigns them to length and width. an overloading constructor that accepts one parameter of type double and assigns it to both length and width setLength: a member function that accepts a double parameter and assigns it to length if it is positive(gerater than zero). setWidth: a member function that accepts a double parameter and assigns it to width if it is positive(gerater than 0) getLength: a member function that accepts no parameter and returns the value of length getWidth: a meber function that accepts no parameters and returns the value of width getAre: a member function that accepts no parameters and returns the area of the rectangle.Create a class Car, which contains • Three data members i.e. carName (of string type), ignition (of bool type), and currentSpeed (of integer type)• A no-argument constructor to initialize all data members with default values• A parameterized constructor to initialize all data members with user-defined values• Three setter functions to set values for all data members individually• Three getter function to get value of all data members individually• A member function setSpeed( ) // takes integer argument for setting speedDerive a class named Convertible that contains• A data member top (of Boolean type)• A no-argument constructor to assign default value as “false” to top• A four argument constructor to assign values to all data-members i.e. carName, ignition,currentSpeed and top.• A setter to set the top data member up• A function named show() that displays all data member values of invoking objectWrite a main() function that instantiates objects of Convertible class and test the…Create a class Car, which contains • Three data members i.e. carName (of string type), ignition (of bool type), and currentSpeed (of integer type) • A no-argument constructor to initialize all data members with default values • A parameterized constructor to initialize all data members with user-defined values• Three setter functions to set values for all data members individually• Three getter function to get value of all data members individually• A member function setSpeed( ) // takes integer argument for setting speedDerive a class named Convertible that contains • A data member top (of Boolean type) • A no-argument constructor to assign default value as “false” to top• A four argument constructor to assign values to all data-members i.e. carName, ignition, currentSpeed and top.• A setter to set the top data member up • A function named show() that displays all data member values of invoking objectWrite a main() function that instantiates objects of Convertible class and test the…