Correct the following code fragment and what will be the final results of the variable a and b: class A { protected int x1,y1,z; public: A(a, b,c):x1(a+2),y1 (b-1),z(c+2) { for(i=0; i<5;i++) x1++; y1++;z++;}}; class B { protected: int x,y; public: B(a,b):x(a+1),y(b+2) { for(i=0; i<5;i++) x+=2; y+=1;}}; class D:public B, virtual public A { private: int a,b; public: D(k,m,n): a(k+n), B(k,m), b(n+2),A(k,m,n) { a=a+1;b=b+1;}}; int main() {D ob(4,2,5);}
Q: Computers of today are very powerful, which explains why this is the case. For the last several…
A: Computers are very powerful for a variety of reasons. They operate with extraordinary speed,…
Q: Create a java class named Shipment a. The program must ask for two separate packages to ship b.…
A: a. The program must ask for two separate packages to ship b. The program must calculate the cost…
Q: Make the programming easy Make the programming complex O Provide better features O Provide more…
A: Implementation complexity, efficiency, robustness, scalability, quality of service and experience…
Q: Q) BEZIER CURVE PRODUCED BY BERSTEIN BASES FUNCTION HAS LIMITED FLEXIBILITY. JUSTIFY THE STATEMENT.
A:
Q: What exactly is knowledge? and how is "knowledge" portrayed in the realm of computers? Give…
A: Knowledge is knowing facts that come from learning and experience.
Q: In your own words, define CFD and explain the essential phases of the solution technique.
A: Computational Fluid Dynamics: In order to depict how a gas or liquid travels and how it affects…
Q: B) Write a MATLAB program that prompt the user to enter a matrix (A), then generate and display the…
A: Answer:
Q: A company is granted the site address 111.0.0.0 The company needs 1025 subnets, how many addresses…
A: The Answer is
Q: You have a web application running on six Amazon EC2 instances, consuming about 45% of resources on…
A: The above question is solved in step 2 :-
Q: How to run IBM SPSS
A: To download and introduce IBM SPSS Statistics Subscription, go to the IBM Marketplace and…
Q: The critical path for the network activities shown below is ________ with duration ________.…
A: Complete answer is given below:
Q: What are the many kinds of software maintenance there to choose from?
A: Examples of software maintenance include: Remedial Maintenance Software fault rectification…
Q: #Write a C program in code blocks to find whether a number is Palindrome or Not. Discussed the…
A: #include <stdio.h> void main(){ i nt num,r,sum=0,t; printf("Input a number: ");…
Q: Consider 2 sorted lists of size 50 and 60 respectively. Find the number of comparisons needed in the…
A: The number of comparisons needed by the merge sort algorithm to merge two sorted lists of sizes m…
Q: Abstract class can be inherited Abstract class defines only the structure of the class not its…
A: The question has been answered in step2
Q: The this pointer is accessible (i) Within all the member functions of the class (ii) Only within…
A: The pointer is the variable whose value is the address of the another variable, i.e. direct address…
Q: Create a new Python file in this folder called task3.py. • Design a program that determines the…
A: According to the information given:- We have to follow the instruction mentioned in order to…
Q: Is it accurate to say that neural networks handle data sequentially? Explain.
A: SOLUTION: Recurrent Neural Networks (RNN) are a type of Artificial Neural Network that can process a…
Q: Your company has a website where you can advertise your products or services to people all over the…
A: Introduction: Your company's goods and services can be advertised everywhere in the globe on the…
Q: 3 4 9 ID 8 5 Give adjacency list representation: 1. Given a graph G: 10 1 23456 7 8 9 12…
A: INTRODUCTION: An adjacency list is a group of unordered lists used to describe a finite graph in…
Q: Assume that all the statements from Q.6.2 have been executed on the database. Determine the results…
A: Given: We are asked to give the output of this query.
Q: When it comes to portability, what is the most important property of the Java programming language?
A: Answer:
Q: Briefly the describe the valuation mechanisms for NFTs and Metaverseprojects. (max 500 word)
A: The above question is answered in step 2 :-
Q: Why do standards change more often than policies?
A: There are a couple of potential clarifications for why norms are more probable than strategies to…
Q: B) Write a MATLAB program that displays the letter grade (A+, A, B+, B, C+, C, D+, D, or F) relative…
A: The general ranges of marks for the letter grades are taken in the solution and the if-else…
Q: Q2\ If Matrix A=[linspace(0,3,4); 0 2 1 3; 1 4 0 0; -1 -2 1 2], find the following expres 1. Delete…
A: As per our guidelines we are suppose to answer the first three questions. Kindly post the remaining…
Q: Why is testing insufficient to ensure correctness?
A: Introduction: Testing is the process of analysing a programme to see whether it is capable of…
Q: There is a substantial gap between the software development life cycle (SDLC) and techniques.…
A: Software Development Lifecycle (SDLC): A series of methods for developing high-quality software that…
Q: few instances of how customized software may be applied (Applications that are produced for people…
A: Given: It is essential that we highlight a few of the specialized software programmes known as…
Q: B) Write a MATLAB program that displays the letter grade (A+, A, B+, B, C+, C, D+, D, or F) relative…
A: Given: We have to write a matlab program that display the letter grade (A+ , A , B+ , B , C+ , C ,…
Q: Why do we convert values of Categorical Variable to numerical values? _nswer:
A: Dear Student, I am assuming your question is related to machine learning the answer based on it is…
Q: Describe how a combination of modulation techniques could be used to convey data.
A: Introduction: Modulation modifies the properties of the wave to be conveyed by superimposing the…
Q: a) b) c) d) 8. ibe iB Assume for each part of this problem that the EAX register contains 00 00 00…
A:
Q: What are IPSec's benefits and drawbacks compared to other network security options, such as…
A: Benefits 1. Network Layer Security: IPsec can monitor all traffic travelling over the network since…
Q: The Cupid matchmaking Service maintains two files - one for the male clients and another for female…
A: CODE - #include<iostream> #include<fstream> using namespace std; int main(){ ifstream…
Q: Question 8 Which array stores the following heap? O 967543 O b. 9654731 OC 1345679 Od 456973 Moving…
A:
Q: (Java) Data fields are encapsulated with which modifier?
A: Encapsulation in Java is defined as a process of wrapping code and data together into a single unit.…
Q: 2. The Lucas series is series based on adding two previous terms defined as ifn=0 ifn=1 L-1+L-2 ifn…
A: CODE TO COPY: #function definition def L(n): #if n is 0 return 2 if n==0: return 2 #if n is 1…
Q: Explain what is meant by the zone routing protocol for advanced routing ?
A: Advance Routing:- Advance routing is a type of Netcloud service platform. And this is available for…
Q: Which technique can be used to integrate AWS IAM with an onpremise LDAP directory service?
A: This question is asking for integration techniques for aws and ldap.
Q: Q3\A) Write a MATLAB program that calculate the first 70 terms from the following series: √2 sin(2x)…
A: MATLAB defines functions for sine and cosine calculations as sin() and cos(). Also exponential…
Q: he true statements. Select all that apply: -Static methods of a class can be called without…
A: Lets see the solution.
Q: To begin with, what is a derived property? I'd want to see an example of this. Is it better to store…
A: A derived class is a Java class that inherits properties from its super class. Derived properties…
Q: What exactly is a wifi evildirect attack, and how does it work? Please refrain from utilising…
A: Introduction: An EvilDirect may be created by setting a rogue GO running on the same channel as a…
Q: Defect elimination, not prevention, is the principle of Cleanroom Software Engineering, which…
A: Cleanroom Software Engineering: Errors may be identified earlier in the lifecycle thanks to…
Q: Q1\A) Write a MATLAB program to generate the matrix (y). y = 00 0 0 0 0 0 0 6 0 1 2 4 0 3 5
A: MATLAB Program: % Taking the 4X4 Matrix format as AA = [0 0 0 0; 1 0 0 0; 2 3 0 0; 4 5 6 0]; % For…
Q: The statement passes a value back to a function's caller.
A: The question has been answered in step2
Q: PCs using Chrome OS need less internal storage space than those running rival desktop operating…
A: Desktop-Operating-System: Filters. The user's machine's control software (desktop or laptop).…
Q: The phrase "machine learning" is a broad one. When developing medical AI systems, make a list of the…
A: Answer:
Q: B) Give suitable MATLAB command for the following descriptions: 3. Percent; denotes a comment;…
A: 1. Percent; denotes a comment; specifies output format. Answer: To add comments to MATLAB code, use…
Step by step
Solved in 4 steps with 2 images
- class A Q5: Correct the following code fragment and what will be the final results of the variable a and b { protected int x1,y1,z; public: A(a, b,c):x1(a+2),y1(b-1),z(c+2) { for(i=0; i<5;i++) x1++; y1++;z++;}}; class B { protected: int x,y; public: B(a,b):x(a+1),y(b+2) { for(i=0; i<5;i++) x+=2; y+=1;}}; class D:public B, virtual public A { private: int a,b; public: D(k,m,n): a(k+n), B(k,m),b(n+2),A(k,m,n) { a=a+1;b=b+1;}}; int main() {D ob(4,2,5);}class A {protected int x1,y1,z; public: A(a, b,c):x1(a+2),y1(b-1),z(c+2) { for(i=0; i<5;i++) x1++;y1++;z++;}}; class B {protected: int x,y; public: B(a,b):x(a+1),y(b+2) { for(i=0; i<5;i++) x+=2; y+=1;}}; class D:public B, virtual public A { private: int a,b; public: D(k,m,n): a(k+n), B(k,m),b(n+2),A(k,m,n) { a=a+1;b=b+1;}}; int main() (Dob(4,2,5);} what the values of x1,y1 and z//Please Fix this program #include<iostream>using namespace std;class Point{private:int x, y;public:Point() {}Point(int x1, int y1) { x = x1; y = y1; }Point(const Point &p1) {x = p1.x; y = p1.y; } // Copy constructorint getX() { return x; }int getY() { return y; }};int main(){Point p0(); // Calling Default ConstructorPoint p1(10, 15); // Calling Parameterized constructorPoint p2 = p1; // Calling Copy constructorcout << "p0.x = " << p0.getX() << ", p0.y = " << p0.getY();cout << "p1.x = " << p1.getX() << ", p1.y = " << p1.getY();cout << "\np2.x = " << p2.getX() << ", p2.y = " << p2.getY();return 0;}
- Explain below code #include <iostream>#include <cmath>using namespace std; const int DIAMETER = 20; // diameter of each ringconst int SPACE = 5; // space between rings class Circle{ public: void drawOlympicRings(int RINGS) { for (int y = 0; y < DIAMETER; y++) { for (int x = 0; x < RINGS * (DIAMETER + SPACE) - SPACE; x++) { bool draw = false; // calculate the distance from the center of each ring for (int i = 0; i < RINGS; i++) { int cx = (DIAMETER / 2) + i * (DIAMETER + SPACE); int cy = DIAMETER / 2; int dx = x - cx; int dy = y - cy; float d = sqrt(dx * dx + dy * dy); if (d <= DIAMETER / 2) { draw = true;…oop using c++ please give me full answer thanks Write a Program that implements Base class calculator and a Derived class scientific calculator, The Derived class should take the basic operations i.e. add, divide, subtract from calculator. However it should have its own methods such as square root.Note: The code is written you can just tell the explanation what is happening in the code Explain in English.Just explain the whole code. #include <iostream>using namespace std;class PrimeNumberGenerator{private:int counter;public://ConstructorPrimeNumberGenerator() : counter(0){}//Function to reset countervoid reset(){counter = 0;}int getCounter(){return counter;}//Function to return next prime number after currentPrimeint getNextPrime(){if(counter == 0){counter = 2;}else{for(int i = counter + 1; ; i++){if(isPrime(i)){counter = i;break;}}}return counter;} //Function to check if a number is prime or notbool isPrime(int num){for(int i = 2; i <= num/2; i++){if(num % i == 0)return false;}return true;}}; int main() {int option;PrimeNumberGenerator gen;cout << "Enter 1 if you want to reset\n";cout << "Enter 2 if you want to get next prime number\n";cout << "Enter -1 to quit: ";cin >> option;while(option != -1){if(option == 1){gen.reset();cout <<…
- QI: (a) Find the errors in the following also explain what causes the error class Student int getid() private: int *id; int semester; string name; double cgpa; static int totalStudent; return *id; double getCgpa() return cgpas public: static int getSemester() Student () { id = new int(); name = ""; cgpa = e; totalStudent++ return semester; void setCgpa(int c) const cgpa = c; void setSection(char sec) Student (int *i,int s,string n, double c) id = i; section = sec; static int getTotalStudent() semester = s; name = ""; cgpa = e; totalstudent++; totalStudent =5; return totalStudent;Consider the following class definition: (8)class base{public:void setXYZ(int a, int b, int c);void setX(int a);int getX() const { return x; }void setY(int b);int getY() const { return y; }int mystryNum() { return (x * y - z * z); }void print() const;base() {}base(int a, int b, int c);protected:void setZ(int c) { z = c; }void secret();int z = 0;private:int x = 0;int y = 0;};a. Which member functions of the class base are protected?b. Which member functions of the class base are inline?c. Write the statements that derive the class myClass from classbase as a public inheritance.d. Determine which members of class base are private, protected,and public in class myClass.Consider the following class definition: (8) class base { public: void setXYZ(int a, int b, int c) ; voidsetX ( int a ) ; int getX ()const{returnx; } void setY ( int b ); intgetY()const{returny; } int mystryNum () {return ( x &*#x00A0;y - z &*#x00A0;z) ;} void print () const; base () } base(int a, int b, int c); protected: void setz ( int c) { z= c; } void secret(); int z= 0; private: int x= 0; int y = 0; }; a. Which member functions of the class base are protected? b. Which member functions of the class base are inline? c. Write the statements that derive the class myclass from class base as a public inheritance. d. Determine which members of class base are private, protected, and public in class myclass.
- JAVA Language Caesar Shift Question: Modify the Caesar class so that it will allow various sized shifts to be used, instead of just a shift of size 3. (Hint: Use an instance variable in the Caesar class to represent the shift, add a constructor to set it, and change the encode method to use it.) import java.util.*; public class TestCipher { public static void main(String[] args) { int shift = 7; Caesar caesar = new Caesar(); String text = "hello world"; String encryptTxt = caesar.encrypt(text); System.out.println(text + " encrypted with shift " + shift + " is " + encryptTxt); } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new StringBuffer(""); // Use a StringBuffer StringTokenizer words = new StringTokenizer(s); // Break s into its words while (words.hasMoreTokens()) { // For each word in s…Consider the following code segment and answer questions 14 and 15. class Point { public: Point (double x = -99, double y = -99) { this -> xM = x; this -> yM = y;} double getx () {return xM; } double gety () {return yM; } void setx (double x) {this -> xM = x; } void sety (double y) {this -> yM = y; } private: double xM, yM; }; 14. What is the output of the following code snippet: Point pl (100); cout << pl.getx() << " " << pl.gety(); a. The output of the program is: -99 -99 b. The output of the program is: 100 100 c. The output of the program is: -99 100 d. The output of the program is: 100 -99 e. None of the above. It doesn't compile because constructor of Point needs two arguments. 15. How many times does the constructor of class Point get called by the following code snippet: Point a (100, 200); Point b[6]; Point *c = new Point; Point *d = new Point (300, 400); a. Four times b. Three times c. Nine times d. Two times e. None of the aboveObject oriented programming C++ Use Classes Write a C++ program in which each flight is required to have a date of departure, a time of departure, a date of arrival and a time of arrival. Furthermore, each flight has a unique flight ID and the information whether the flight is direct or not.Create a C++ class to model a flight. (Note: Make separate classes for Date and Time and use composition).add two integer data members to the Flight class, one to store the total number of seats in the flight and the other to store the number of seats that have been reserved. Provide all standard functions in each of the Date, Time and Flight classes (Constructors, set/get methods and display methods etc.).Add a member function delayFlight(int) in the Flight class to delay the flight by the number of minutes pass as input to this function. (For simplicity, assume that delaying a flight will not change the Date). Add a member function reserveSeat(int) which reserves the number of seats passed as…