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.Write a base class Computer that contains data members of wordsize (in bits), memory size in megabytes, and storage size in megabytes and speed in megahertz. Drive a Laptop class that is kind of computer but also specifies the object’s length width, height and weight. Member functions for both classes should include a default constructor, a constructor to initializes all components and a function to display data members.
- 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…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…
- Write a base class Computer that contains data member of wordSize (in bits), memorySize (in megabytes), storageSize (in megabytes) and speed (in megaHertz). Drive a Laptop class that s a kind of Computer but also specifies the objects length, width, height and weight. Member functions both classes should include a default constructor, a constructor to initialize all components and a function to display data members.The Critter class is a base class with some basic functionality for running simulations of different kinds of critters. Critters can move, act, and remember their history. A typical simulation contains a number of critters of different types. In each step of the simulation, the act member function will be called on each critter. Define a class Sloth derived from Critter that simulates a sloth. Sloths alternate between eating and sleeping. Add the word "eat" or "sleep" to the history each time the act function is called. The implementation of the Critter class is not shown. Complete the following file: sloth_Tester.cpp #include <iostream>using namespace std; #include "critter.h" /**A sloth eats and sleeps.*/class Sloth : public Critter{public:Sloth();. . .private:. . .}; Sloth::Sloth(){. . .} void Sloth::act(){if (...) {add_history("eat");...}else{add_history("sleep");... }} int main(){Sloth sloth;sloth.act();cout << sloth.get_history() << endl;cout <<…Define a class that captures airline tickets. Name the class as Airline Ticket. Each ticket lists the departure and arrival cities, a flight number, and a seat assignment. A seat assignment has both a row and a letter for the seat within the row (such as 12F). Include appropriate constructor, destructor and a print fucntion in your class definition. Make two examples of tickets and print the values using the print member function.
- Write base class with the name Shape . The Shape class have Private Variable: area, a double used to hold the shape's area. Public Member Functions: getArea the Accessor. This function should return the value in the member variable area. Parameterized constructor—Initializes area member. Defualt constructor— Empty body calcArea. This function should be a incomplete function.Next, define a class named Triangle . It should be child of Shape class. It should have the following members:Protected Member Variables: base, a integer used to hold the base of triangle.Height, a integer used to hold the height of the triangle. Public Member Functions: constructor—Initializes values for base, height. The overridden calcArea function in Circle described below.calcArea—calculates the area of the Triangle (1/2* base * height) and stores the result in the inherited member area.After you have created these classes, create a driver program that defines a Triangle object. Demonstrate that each object…Design the class doctorType, inherited from the class personType, defined in Chapter 10, with an additional data member to store a doctor’s specialty. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Design the class billType with data members to store a patient’s ID and a patient’s hospital charges, such as pharmacy charges for medicine, doctor’s fee, and room charges. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. If no value is provided for a charge, it should default to 0. Design the class patientType, inherited from the class personType, defined in Chapter 10, with additional data members to store a patient’s ID, age, date of birth, attending physician’s name, the date when the patient was admitted in the hospital, and the date when the patient was discharged from the hospital. (Use the class dateType to store the date of birth, admit date, discharge date, and the…Design the class doctorType, inherited from the class personType, defined in Chapter 10, with an additional data member to store a doctor’s specialty. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. Design the class billType with data members to store a patient’s ID and a patient’s hospital charges, such as pharmacy charges for medicine, doctor’s fee, and room charges. Add appropriate constructors and member functions to initialize, access, and manipulate the data members. If no value is provided for a charge, it should default to 0. Design the class patientType, inherited from the class personType, defined in Chapter 10, with additional data members to store a patient’s ID, age, date of birth, attending physician’s name, the date when the patient was admitted in the hospital, and the date when the patient was discharged from the hospital. (Use the class dateType to store the date of birth, admit date, discharge date, and the…