What's wrong, if anything, with the following code? class Kitchen { private: double kit_sq_ft; public: Kitchen() { kit_sq_ft = 0.0; } virtual double area() { return kit_sq_ft * kit_sq_ft; } }; class House : public Kitchen { private: double all_sq_ft; public: House() { all_sq_ft += kit_sq_ft;} double area(const char *s) { cout << s; return all_sq_ft; } };
Q: Consider the significance that wireless networks have in the economies of less developed countries.…
A: Introduction: Physical cabling is not required for all networks. Wireless networks are becoming more…
Q: The method used to install and configure Windows Server 2012 in a company may be a source of…
A: Beginning: The IP address management role in Windows Server 2012 may assist with activities…
Q: What is the technical term for compressing the Microsoft Developer Network?
A: Introduction: The bandwidth of the internet is a finite resource. The responsiveness of an app is…
Q: Which server operating systems are compatible with the Ubuntu Server OS?
A: Introduction: The fundamental aspect of the Ubuntu server operating system is that it is free, yet…
Q: If you want to understand how a process works, use Structured English to explain it.
A: Structured English: Using sequential judgments, iterations, and case structures, all reasoning is…
Q: Consider the differences between a firewall and a packetized data flow
A: Given To know about the differences between a firewall and a packetized data flow.
Q: Distinguish between interrupted and non-interrupted OSes in terms of overall performance, with the…
A: Introduction: Interrupt-driven operating systems are more responsive and efficient than…
Q: In your Engineering program, how do you plan to link the various programming ideas?
A: Programming: Programming is a complicated and appealing field that appeals to a wide range of…
Q: Consider an instruction consisting of operation code (opcode), source register and destination…
A: Given, Size of an instruction = 32 bits This is because the given system is a 32 bit processor.…
Q: When and how did the abacus first come into use?
A: INTRODUCTION: The abacus, sometimes known as the "World's First Computing System," was used by…
Q: A computer-based organization is distinct from architectural design in that computers, rather than…
A: Computer architecture: Computer architecture is a functional description of section needs and design…
Q: Which factors serve as the impetus for the ongoing and costly investments in infrastructure that are…
A: Mobile network is something that is need even when sleeping. Now the need of internet and…
Q: In this section, a concise explanation need to be provided for the two functions of an operating…
A: operating system: The term "operating system" refers to the software that enables a computer to…
Q: Why is it important to separate the data into two sets for training and validation? What will the…
A: Introduction Validation is the process of confirming that something is true or correct. The…
Q: When discussing processes outside of systems analysis, use structured English.
A: Given: Structured English is derived from structured logic; it is used in situations in which the…
Q: What distinguishes Ubuntu Server from other server operating systems?
A: Introduction: Ubuntu is a Linux-based operating system. It's designed to operate with computers,…
Q: What are the benefits of using a circuit-switched network as opposed to a packet-switched one?
A: Explanation: A packet-switched network combines data packets into a single package or device through…
Q: We have a very limited understanding of how computer operating systems work. The term "operating…
A: Encryption: Operating systems are software programmes that control and run computing devices such as…
Q: How exactly can you use netstat to determine whether or not you have been infected?
A: The netstat can be denoted as a command-line network utility that prints network connections for…
Q: What exactly is "network topology"? Various network topologies must be identified and simply…
A: Introduction: The physical or logical arrangement of nodes and links makes up the network's…
Q: Define and explain each individual component of the core of the operating system, beginning with the…
A: operating system: The Kernel's Components The kernel of a computer operating system is the same as…
Q: Explain how a firewall and a packetized data stream are comparable.
A: A correct answer is an option. Essential Considerations The firewall may reassemble a data stream…
Q: (4) 4. Let P(x,y)= "x sent a text message to y." The u.d. for both x and y is all people. Translate…
A: Given: Given the following translate into symbols.
Q: What are the best attributes for a student-programmer to becomesuccessful in building computer…
A:
Q: Suppose we train a model to predict whether an email is Spam or Not Spam. John always forgets to…
A: The above question is solved in step 2 :-
Q: Is there a way that modern technology may be used in such a manner as to improve educational…
A: Definition: The term "information and communication technologies" (ICT) refers to a broad category…
Q: C) = A(B+ A(B+ (C e minimum number ed to implement O(A
A:
Q: Windows Service Control Manager will be examined in this article.
A: Given: SCM starts, pauses, and interacts with Windows service processes. When the system boots, SCM…
Q: Why is it necessary to access BIOS/UEFI configuration on a computer or BIOS settings on a virtual…
A: Intro Why is it necessary to access BIOS/UEFI configuration on a computer or BIOS settings on a…
Q: What does "programming a computer" really mean? When choosing a programming language, what…
A: Programming a Computer basically means the process which gets involved into performing a specific…
Q: PROBLEM: Using OOP and functions, create a program that allows a user to customize his/her online…
A: Hello student Greetings Hope you are doing great. I will try my best to answer your question. Thank…
Q: What can Windows Service Control Manager do for you? We'll find out in this post.
A: Given: SCM is a Windows NT function that launches, stops, and interacts with Windows service…
Q: If two or more individuals are working together, what does it mean? Collaborative interfaces may be…
A: Collaboration: Collaboration is working with another individual or group to obtain or accomplish…
Q: We have seen that some data structures can store heterogeneous components. What is meant by the term…
A: In Data Structure, There are two main types of structures: Homogeneous Data Structure Heterogeneous…
Q: Main.java DrivingCost.java 1- import java.util.Scanner; 3 public class DrivingCost 4-{ 5 6 public…
A: Let's see the solution in the next steps
Q: What is artificial intelligence's ultimate goal? Give a brief overview of the main categories and…
A: The Answer is in step2
Q: Let's speak about how data mining may be put to use for different purposes.
A: What Is Data Mining? Data mining is the practice of evaluating hidden patterns in data from many…
Q: What does a firewall protect against?
A: Firewalls are utilized to safeguard the Computer organization and limits unlawful traffic. Denial of…
Q: 9. Write the inorder traversal of the subtree rooted at "x" from the Binary Tree H. h n m Binary…
A: A tree needs all of its leaf nodes to be at approximately at the same height, is considered to be…
Q: Unfortunately, we are unable to disclose the processes through which operating systems carry out…
A: The solution may be found here: The operating system (OS) of a computer is what connects the user to…
Q: Why is a sliding window better than a stop-and-go protocol?
A: To be determined: sliding window better than a stop-and-go protocol.
Q: Assume a computer sends a packet to another computer through the Internet's transport layer. There…
A: Intro At the transport layer, the question is regarding the interchanging packets between two…
Q: What is the only way to protect a computer's central processor unit against electrostatic discharge?
A: Intro Method to keep a computer's central processing unit secure from electrostatic discharge will…
Q: Which statement from below is correct to initialize a List to include 5 subject names of a week…
A: List is a generic class in c# which can contain list of objects. In the above question we have to…
Q: What were some of the implications of Konrad Zuse’s innovations in computing?the response should be…
A: Introduction: We must discuss Konard Zuse's contribution to the world of computers. Given: What…
Q: What exactly is a Windows Service, and how does it function?
A: Intro Windows services Windows services are a special type of application that is configured to…
Q: Explain how you'll use different splits on a given dataset to automatically find a reasonable value…
A: The regularization parameter is a control of the fitting parameters. That means if the magnitude of…
Q: Distinguish between interrupted and non-interrupted OSes in terms of overall performance, with the…
A: Given: According to this question, the performance of interrupt-driven operating systems is superior…
Q: Why is it that people look at the internet as a successful example of information and communications…
A: Given: ICT stands for information and communication technology (ICT) ICT is based on new forms of…
Q: Describe the procedure for routing data over a wide area network.
A: Intro Here, we need to figure out how to route over an extensive area network. To set up a…
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:
What's wrong, if anything, with the following code?
class Kitchen {
private:
double kit_sq_ft;
public: Kitchen() { kit_sq_ft = 0.0; } virtual double area() { return kit_sq_ft * kit_sq_ft; }
};
class House : public Kitchen {
private:
double all_sq_ft; public:
House() { all_sq_ft += kit_sq_ft;} double area(const char *s)
{
cout << s;
return all_sq_ft; } };
Step by step
Solved in 2 steps
- For the following four classes, choose the correct relationship between each pair. public class Room ( private String m type; private double m area; // "Bedroom", "Dining room", etc. // in square feet public Room (String type, double area) m type type; m area = area; public class Person { private String m name; private int m age; public Person (String name, int age) m name = name; m age = age; public class LivingSSpace ( private String m address; private Room[] m rooms; private Person[] m occupants; private int m countRooms; private int m countoccupants; public LivingSpace (String address, int numRooms, int numoccupants) m address = address; new int [numRooms]; = new int [numOceupants]; m rooms %3D D occupants m countRooms = m countOccupants = 0; public void addRoom (String type, double area)What will be the resulting value of total after the following code executes? class Measurement { private: double length; public: // Constructor Measurement (double len) { length = len; } // Copy Constructor Measurement (const Measurement &measurement_object) { length = measurement_object.length; } double getlength() const { return length; } }; int main() Measurement sample1(5); Measurement sample2 = sample1; double total = sample1.getlength() + sample2.getLength();Assume you have the following two classes: public class Bag{ private String name; public Bag() { name = "Fancy bag"; } } public class Backpack extends Bag { private int noCompartments; // number of compartments in a backpack public Backpack() { noCompartments = 1; } %3D public int getNoCompartments() { return noCompartments; } } Assume that you have a variable of type Bag initialized to an object instance of type Backpack, as follows: Bag bag = new Backpack(); Show a fragment of code to print the number of compartments in a Bag referenced by the variable bag, as assigned above.
- Question 1 public class Flat { private int noOfRooms; private double area; private boolean seaView; public Flat() { noOfRooms = 3; area = 200; seaView = true; } %3D public void setFlat(int n, double a, boolean s) { noOfRooms = n; area = a; seaView = s; } public int getNoOfRooms( ) { return noOfRooms; } public double getArea( ) { return area; } public boolean getSeaView( ) { return seaView; } } Write a static method named findFlats that takes as a parameter an array of type Flat named list. The method should count and return the number of flats that have 3 or more rooms and with a sea view. The method prototype is: public static int findFlats (Flat[] list); Note: assume the array is already declared, populated with data in the main method and ready to be used.Given the following code segment. class Bike { private int wheels; public void setWheel(int wheel) { wheels = wheel; } public class BikeApp { public static void main() Bike bike1 = new Bike(); Bike bike2 = new Bike(2); bike1.setWheel(3); a) Write two suitable constructors for class Bike. (2 marks) b) Modify the above code necessarily. Then add code to displays on the screen the number of wheels for each object. (3 marks) TTT Arial : 3 (12pt) :T E - E -. Click Save and Submit to save and submit. Click Save All Answers to save all answers. Save All Answers Close Windpublic class FoodItem { private String name; private double fat; private double carbs; private double protein; // TODO: Define default constructor // TODO: Define second constructor with parameters to initialize private fields (name, fat, carbs, protein) public String getName() { return name; } public double getFat() { return fat; } public double getCarbs() { return carbs; } public double getProtein() { return protein; } public double getCalories(double numServings) { // Calorie formula double calories = ((fat * 9) + (carbs * 4) + (protein * 4)) * numServings; return calories; } public void printInfo() { System.out.println("Nutritional information per serving of " + name + ":"); System.out.printf(" Fat: %.2f g\n", fat); System.out.printf(" Carbohydrates: %.2f g\n", carbs); System.out.printf(" Protein: %.2f g\n", protein); }} import java.util.Scanner; public class NutritionalInfo {…
- Subclass toString should call include super.toString(); re-submit these codes. public class Vehicle { private String registrationNumber; private String ownerName; private double price; private int yearManufactured; Vehicle [] myVehicles = new Vehicle[100]; public Vehicle() { registrationNumber=""; ownerName=""; price=0.0; yearManufactured=0; } public Vehicle(String registrationNumber, String ownerName, double price, int yearManufactured) { this.registrationNumber=registrationNumber; this.ownerName=ownerName; this.price=price; this.yearManufactured=yearManufactured; } public String getRegistrationNumber() { return registrationNumber; } public String getOwnerName() { return ownerName; } public double getPrice() { return price; } public int getYearManufactured() { return yearManufactured; }…Parking Ticket SimulatorFor this assignment you will design a set of classes that work together to simulate apolice officer issuing a parking ticket. The classes you should design are:• The Parkedcar Class: This class should simulate a parked car. The class's respon-sibilities are:To know the car's make, model, color, license number, and the number of min-utes that the car has been parkedThe BarkingMeter Class: This class should simulate a parking meter. The class'sonly responsibility is:- To know the number of minutes of parking time that has been purchased• The ParkingTicket Class: This class should simulate a parking ticket. The class'sresponsibilities areTo report the make, model, color, and license number of the illegally parked carTo report the amount of the fine, which is $2S for the first hour or part of anhour that the car is illegally parked, plus $10 for every additional hour or part ofan hour that the car is illegally parkedTo report the name and badge number of the police…Java Programming Please do not change anything in Student class or Course class class John_Smith extends Student{ public John_Smith() { setFirstName("John"); setLastName("Smith"); setEmail("jsmith@jaguar.tamu.edu"); setGender("Male"); setPhoneNumber("(200)00-0000"); setJNumber("J0101459"); } class MyCourse extends Course { public MyCourse { class Course { private String courseNumber; private String courseName; private int creditHrs; public Course (String number, String name, int creditHrs){ this.courseNumber = number; this.courseName = name; this.creditHrs = creditHrs; } public String getNumber() { return courseNumber; } public String getName() { return courseName; } public int getCreditHrs() { return creditHrs; } public void setCourseNumber(String courseNumber) { this.courseNumber = courseNumber; } public void setCourseName(String…
- Write a Rectangle class that has the following fields: Length (L): a double Width (W): a double The class should have the following functions: Constructor: accepts the length (L) and the width (W) of a rectangle as arguments. Constructor: does not take any parameters and initializes the length(L) and width(W) to zero. A function called getArea which returns the area of the rectangle. A function called getPerimeter which returns the perimeter of the rectangle. {note: The area of a rectangle = L*W, and its perimeter = 2*(L+W) } Then, write a program to ask the user to enter the length and width of a rectangle, and then use the above class to calculate and print the area and perimeter of the rectangle.Consider the following class:1 public class Student {2 private int studentNumber;3 private Student labPartner;4 private static Student classPres = null;5 private static int nextStudentNumber = 100;67 public Student () {8 this.studentNumber = Student.nextStudentNumber;9 Student.nextStudentNumber ++;10 this.labPartner = null;11 }1213 public void setLabPartner (Student labPartner) {14 this.labPartner = labPartner;15 }1617 public static void setClassPres (Student pres) {18 Student.classPres = pres;19 }20 }(a) Write code that is able to construct an array of 1000 student objects and loads them in increasingstudent number order into that array. The lab partners of these students should all be null. TheclassPres should also be null.class IndexItem { public: virtual int count() = 0; virtual void display()= 0; };class Book : public IndexItem { private: string title; string author; public: Book(string title, string author): title(title), author(author){} virtual int count(){ return 1; } virtual void display(){ /* YOU DO NOT NEED TO IMPLEMENT THIS FUNCTION */ } };class Category: public IndexItem { private: /* fill in the private member variables for the Category class below */ ? int count; public: Category(string name, string code): name(name), code(code){} /* Implement the count function below. Consider the use of the function as depicted in main() */ ? /* Implement the add function which fills the category with contents below. Consider the use of the function as depicted in main() */ ? virtualvoiddisplay(){ /* YOU DO NOT NEED TO IMPLEMENT THIS FUNCTION */ } };