-
Read the following code and then implement the following parts:
Read the following code and then implement the following parts:
class Point {
public int xCoordinate;
public int yCoordinate;
}
1. Derive a class from Point and call it DerivedPoint, the new class will contain two constructors, the first one takes no arguments, it assigns the point to the point (1,1) and the second constructor takes two parameters... -
Permutations
Write a program to display all possible permutations of a given input string--if the string contains duplicate characters, you may have multiple repeated results. Here is a sample for the input cat
cat,cta,act,atc,tac,tcaSolve this using C++ code
Write a solution in any language to the following: Given a large list of integers (more than 1 000 000 values) find how many ways there are of selecting two of them that add up to 0
Use of OOPs in C++
What is the use of object oriented system?
What do you mean by inheritance?
Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own.
What is the difference between an object and a class?
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects. Ø A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don't change. Ø The class to which an...
Virtual Constructor
Why constructor cannot be virtual in C++?
Array in Function
Write C++ program tell the user
Press 1 to change Row to Row and change (using Function ) output like that :
1 1 1
2 2 2
3 3 3
and press 2 to change Row to Col and change (using function) output like that :
1 2 3
1 2 3
1 2 3
and press 0 to End the ProgramFlowchart
an electricity board charges the following rates to domestic users to discourage large consumption of energy:
for the first 100 units - 10 paise per unitÂ
 for next 200 units - 20 paisa per unit
 beyond 300 units - 30 paisa per unit . if the total cost is more than 10 OMR then an additional surcharge of 15% is added.draw the flowchart and write the algorithm to calculate the...What is the difference between class and structure?
Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public. Class: Class is a successor of Structure. By default all the members inside the class are private.
Constructor Use
Why the constructor is used?
C++ Macros Functionality
What is the main thing that C++ macros can do that cannot be done with functions? Give a realistically useful example of something of this kind.
Macros have the distinct advantage of being more efficient than functions, because their corresponding code is inserted directly into your source code at the point where the macro is called. There is no overhead involved in using a macro like...What will be the Output?
What will be the result of the following expressions when A = 6, B = 7 and C = 8?
option 1 = D = A + C % B or
option 2 = D = A + B * 5 - CWhat is polymorphism? Explain with an example?
"Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or reference) to assume (be replaced by) or become many different forms of object. Example: function overloading, function overriding, virtual functions. Another example can be a plus ‘+’ sign, used for adding two integers or for using it to concatenate two strings.
Write Object into a File
How will you write object into file using file concepts in C++?
Ans