Write the output of the following C++ code? #include using namespace std; class CDummy { public: int isitme (CDummy& param); }; int CDummy::isitme (CDummy& param) { if (¶m == this) return true; else return false; } int main () { CDummy a; CDummy *b = &a; if (b->isitme(a)) { cout << "execute"; } else { cout<<"not execute"; } return 0; }
Q: Write a C# program that implements a class of your own design. Your class should have minimum of…
A: Program using System;public class Person{ public Person() //default constructor {…
Q: Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly…
A: Actually, program is a executable software that runs on a computer.
Q: Write a function named “HasDashDashOnBothEnds” that accepts 2 parameters of the same as command line…
A: #include <iostream>using namespace std; bool HasDashDashOnBothEnds(int count, char**…
Q: Please help me with the problem C++ Read the following program carefully and answer questions 9 it…
A: C++ used to answer this question
Q: TASK 1:Write a C++ program in which you define a class String and declare two string objects. Your…
A: #include<iostream>#include<string>using namespace std;class String{private: string str;…
Q: Write a C# application that implements a class ‘number” with the following functionality. a. Three…
A: Answer: using System; // make the class numberpublic class number{ // declare field variable…
Q: Consider the following C program void fun(void) int a, b, c/* definition 1/ while C.J int b, c, d;…
A: Please find Re-vised code below:
Q: BELOW MCQ GIVEN ANSWER CAN BE MORE THAN ONE OPTION. PLEASE PROVIDE CORRECT ANSWERS.…
A: Here is the description about the output:
Q: Code in Haskell Programming only Space X is planning to start Star link. Programmers at SpaceX are…
A: Required: Write a code in the given programming language which meets all the conditions given and…
Q: Question Write a C++ program that follows the program requirements in the document provided Declare…
A: C++ code for resister, capacitor, frequency.
Q: program DecimalToBinary that implements the static method decimalToBinary() which converts decimal…
A: We need to use the % and / operators and divide the given number by 2 and capture the reminder and…
Q: Code in Haskell Programming only Space X is planning to start Star link. Programmers at SpaceX are…
A: Required: Write a code in the given programming language which meets all the conditions given and…
Q: please help me with this c++ code, and I did not understand why the output is x=10 y=20. Please…
A: The above code is a simple example of chaining of function calls. The C++ code has used an object to…
Q: Hello, I was making a hangman simulation in C++. The code runs, but not fully. Could you identify…
A: I have found the errors and modified the code. Now it is working completely. The changes were:…
Q: Write a C++ program to create a class called STRING and Implement the following operations. Display…
A:
Q: ?++What is the correct syntax of accessing a static member of a class in C class A public: static…
A: A::value
Q: What is the output of the following C++ code? class Point { private: int x; int y: public: Point(int…
A: We need to find the output of the given code.
Q: 4g. the output of the following C++ code? #include using namespace std; template class XYZ {…
A: Given, Programming language = C++ Code: #include <iostream> using namespace std;…
Q: Solution in JS Write a function that inserts a white space between every instance of a lower…
A: Algorithm - Take input from user. Now use the below logic - return…
Q: CENGAGE | MINDTAP Q Search this course ROSE fuwdhart Woz Writing a Modular Program in C++ Writing a…
A: Flowchart is pictorial diagram of an algorithm. It is used to show, how an algorithm works. It has…
Q: 3. Write a C# application that implements a class 'number" with the following functionality. a.…
A: PROGRAM CODE: using System;class number{int n,dsum,rev;public void readValues(int num){this.n=num;…
Q: Write a running C++ code for a class named Student that make use of the public and private…
A: Here we print the message using the class name called student And print the public and private…
Q: dynamic typing as opposed to static type?
A: In this question we have to understand what exactly to be used between dynamic typing and static…
Q: The following program is written in a new progr and executes without any errors. Its output is the…
A: Sol: we have given one program pseudo code and based on such given code we will answer in the given…
Q: write a java program that overloads a function'printToscreen'. the function prints output to the…
A: Fid the required code in java given as below and sample output :
Q: Show the output of the following code: #include <iostream> using namespace std;class Parent…
A: Answer: Create a derived class that is inherited from the base class. // Derived class class child…
Q: What is the output of the following program? Carefully note the placement of the virtual keyword.…
A: Destructor in c++ -It is a member function of a class used to free the space occupied by or delete…
Q: Write a pythonprogram that reads in a Python source code file and counts the occurrence of each…
A: CODE: #list of keywodskeywords =…
Q: please fix what is wrong with the below C# code:
A: 1. In your code the checkGuess function should be separate from main function 2. Main function…
Q: You are assigned to develop a C++ Program using Classes, Functions, Arrays and Pointers that…
A: // validatePassword function definition bool validatePassword(){ //…
Q: Write an Simple Oop c++ program on template class,use addition of two or three veriable in it
A: Write an Simple Oop c++ program on template class,use addition of two or three veriable in it
Q: what is the output of the following C++ code?
A: The Answer is in Below Step:-
Q: What is the output of the following program? Carefully note the placement of the virtual keyword.…
A: //given code is inheritance in c++ answer: Dog dtor Pet dtor…
Q: Code in Haskell Programming only Space X is planning to start Star link. Programmers at SpaceX are…
A: Required: Write a code in the given programming language which meets all the conditions given and…
Q: ou are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
A: You are said to store data of Hospitals in a city. For that purpose, you are asked to develop a…
Q: QUESTION 15 Python supports the creation of anonymous functions at runtime, using a construct called…
A: Python supports the creation of anonymous functions which means that functions that are not bound to…
Q: Hello, I'm working on this hangman simulation in C++. The code runs but it doesn't count wrong…
A: #include <iostream> #include <cstdlib> #include <ctime> #include <string>…
Q: Question 12 Consider the following program written in C pseudocode: void foo(int x, int y){ y = y +…
A: Please give positive ratings for my efforts. Thanks. ANSWER a) Passed by value a = 6…
Q: Write a C++ program to check for the not-eligible donor by throwing a custom exception. Strictly…
A: main.cpp Donor.cpp
Q: Solution in JS Write a function that inserts a white space between every instance of a lower…
A: In JavaScript string.replace method/function is used to inserts a white space between every instance…
Q: Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly…
A: PROGRAM: #include <iostream> #include <string> #include <locale>…
Q: Hello, I was making a hangman simulation in C++. The code runs, but not fully. Could you identify…
A: C++ Code :- #include<iostream>#include<cstring> // for string class…
Q: This is part of my hangman simulation in C++. If you compile and run it and type "Easy," the code…
A: Answer:
Q: Write the output of the following C++ code. Also, write the name of feature of Object Oriented…
A: Here we have written the function Line with different numbers and types of parameters. Then, in the…
Q: t) Write a one-liner JAVA function that takes a string s and an integer i as the parameters and…
A: Write a one-liner JAVA function that takes a string s and an integer i as the parameters and removes…
Q: write an extension method called toRoman to convert and int to its roman r
A: //Program using System; using System.Collections.Generic; using System.Linq; using System.Text;…
Q: Write a program in C++ that reads a list of enrollments from a file and prints a class roster for…
A: #include <iostream>#include <fstream> using namespace std; /*** structure to store…
Q: What will be the output of the following C++ program? #include using namespace std; class A{…
A: Given, Code: #include <iostream> using namespace std; class A{ public: A(){…
Q: Write a code in c++ to calculate area of triangle (A=1/2 ???ℎ? ∗ ????ℎ). Take objects of class and…
A: Area of the triangle is 1/2( breadth * height ) Using overloading.
Q: What will be the output of the following C# code? class a { public void fun() {…
A: Given: using System;class a { public void fun() { Console.WriteLine("base…
Write the output of the following C++ code?
#include <iostream>
using namespace std;
class CDummy
{
public:
int isitme (CDummy& param);
};
int CDummy::isitme (CDummy& param)
{
if (¶m == this)
return true;
else
return false;
}
int main ()
{
CDummy a;
CDummy *b = &a;
if (b->isitme(a))
{
cout << "execute";
}
else
{
cout<<"not execute";
}
return 0;
}
Step by step
Solved in 3 steps with 2 images
- Answer the question with C - language. Question. In the following code, assume that all function calls are successful. void sigusr1_handler(int sig) { } int main(void) { pid_t child; if ((child = fork()) == 0) { struct sigaction sa; sa.sa_handler = sigusr1_handler; sa.sa_flags = 0; sigemptyset(&sa.sa_mask); sigaction(SIGUSR1, &sa, NULL); while (1) { printf("working ...\n"); sleep(1); } } else { //line 19 sleep(30); } // line 22 return 0; } (a) If you run the above program can it create either an orphan or a zombie process? Explain how. (b) Insert statements in only the part of the code related to the parent process (Lines 19–22) and function siguse1_handler() so that the child process would end after about 30 seconds of running. Clearly indicate where you insert any statements. thank you for your timeYou are said to store data of Hospitals in a city. For that purpose, you are asked to develop a structure of maxHeap using these structures in c++. You have to submit Hospital. h file only class Hospital { string HospitalName;string Address;string HospitalID;public:Hospital(); Hospital(string ,string ,string); Hospital(string HospitalID); // conversion Constructor string getHospitalName()const; string getHospitalId()const; string getAddress()const; void setHospitalName(string); void setHospitalId(string);void setAddress(string); // Relational operators with respect to Hospital Idbool operator<(Hospital)const;bool operator<=(Hospital)const;bool operator>(Hospital)const; bool operator>=(Hospital)const; bool operator==(Hospital)const;bool operator!=(Hospital)const; // output stream operatorfriend ostream& operator<<(ostream&, const Hospital& ref); s}; ostream& operator<<(ostream&, const Hospital& ref); class MaxHeap { public:class Node…What is the output of the following C++ code? #include <iostream> using namespace std; class Base { public: int m; Base(int n=0) : m(n) { cout << "Base" << endl; } }; class Derived: public Base { public: double d; Derived(double de = 0.0) : d(de) { cout << "Derived" << endl; } }; int main() { cout << "Instantiating Base" << endl; Base cBase; cout << "Instantiating Derived" << endl; Derived cDerived; return 0; }
- Need help with a c++ building block question! Nongraded Implement the copy assignment operator= for the StringVar class using the options given on the right side window. Place the code into the left side using the arrows. It is possible to get the test case correct but not complete NOTE: Be careful! There are decoys! The this pointer is used extensively.. Assume that StringVar.h has the following declaration: #include <iostream> class StringVar {public:StringVar() : max_length(20) { // Default constructor size is 20value = new char[max_length+1];value[0] = '\0';}StringVar(int size); // Takes an int for sizeStringVar(const char cstr[]); // Takes a c-string and copies itStringVar(const StringVar& strObj); // Copy Constructor~StringVar(); // Destructorint size() const { return max_length; } // Access capacityconst char* c_str() const { return value; } // Access valueint length() const { return strlen(value); } // Access lengthStringVar& operator= (const StringVar&…Here thr____Calculator.java, to accept an expression as astring in which the operands and operator are separated by zero or more spaces.For example, 3+4 and 3 + 4 are acceptable expressions. Here is a sample run:++please code this for me in c++ using void, functions, loops, (basic c++ not complicated or highlevel please). I tried to code it myself but there are many mistakes I dont know how to fix so please write a similar one for me but it works. The question is only 1 but it has 2 parts (2 different functions that should be in one code) MY CODE: #include <iostream>using namespace std; int IsPalindrome(int p);void GCD(); int main (){ int choice; cout << "Please enter a choice: "<<endl; cout << "Enter one for IsPalindrome "<<endl; cout << "Enter 2 for GCD "<<endl; cout << "Enter 3 to exit the program "<<endl; cout << "Choice: "<<endl; cin >> choice; if (choice == 1) { int p; cout << "Please enter a 3 digit number: "<<endl; cin >> p; if(p%10==p/100) { cout<<p<<" is a palindrome " <<endl; } else {…
- This is C++. Please explain in details so I can understand the questions.What is the output of the following C++ program? #include <iostream>#include <string>using namespace std;class baseClass{public:void print() const;baseClass(string s = " ", int a = 0);//Postcondition: str = s; x = a;protected:int x;private:string str;};class derivedClass: public baseClass{public:void print() const;derivedClass(string s = "", int a = 0, int b = 0);//Postcondition: str = s; x = a; y = b;private:int y;};int main(){baseClass baseObject("This is the base class", 2);derivedClass derivedObject("DDDDDD", 3, 7);baseObject.print();derivedObject.print();system("pause");return 0;}void baseClass::print() const{cout << x << " " << str << endl;}baseClass::baseClass(string s, int a){str = s;x = a;}void derivedClass::print() const{cout << "Derived class: " << y << endl;baseClass::print();}derivedClass::derivedClass(string s, int a, int b) :baseClass("Hello…in c++ , fix all bugs or mistakes in code and explain in comments what was wrong and how you fix it (there can be problems with semi-columns, curly braces, included libraries, wrong usage of functions, inproper conversion of datatypes and etc.) Comment all changes in code and show the outputQuestion 3 Write a program in C, which simulates the game of connect 4, representing the board with coloured tiles, by means of matrices, where the player can choose whether to play with the computer and the computer represents player 2 or with another person, where at the end it shows the winner, the loser or if there was a draw. . Full explain this question very fast solution sent me
- FOR C++, PLASE SEND THE ANSER IN 30 MINUTES. ACCORDING TO CODE BELOW, #include "Vehicle.hh" class Ship: public Vehicle { private: int passenger; public: Ship(); Ship(int, float, float); int getPassenger(); void setPassenger(int); void print(); }; (DEFINE FUNCTIONS CORRESPONDING TO SHIP HEADER CLASS IN PART 2 BELOW) #include "Vehicle.hh" #include "Ship.hh" #include <iostream> using namespace std; // *** DEFINE --VEHICLE-- FUNCTIONS FOR PART 1 *** // *** DEFINE --SHIP-- FUNCTIONS FOR PART 2 *** void reduceSpeed(Ship*, float); void takePassenger(Ship*, int); int main() { return 0; } // reduce the speed of ship given in percentage (0 < percentage < 1). void reduceSpeed(Ship *s, float percentage) { // *** FILL THIS FUNCTION FOR PART 3 *** } // takes the number of passengers to the ship void takePassenger(Ship *s, int pas) { // *** FILL THIS FUNCTION FOR PART 4 *** }Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly implemented as an enumeration — Hearts, Clubs, Diamonds, Spades) from the keyboard. You cannot use a menu. Your program must read the user's choice directly into the card suit variable (of an enum type). (Note: You cannot overload operators for built-in types, but enumerations are, technically, user-defined types. Therefore you can overload input/output operators for them.)Write a program in C++ that allows the user to enter the values to assign a card's suit (commonly implemented as an enumeration — Hearts, Clubs, Diamonds, Spades) from the keyboard. You cannot use a menu. Your program must read the user's choice directly into the card suit variable (of an enum type). (Note: You cannot overload operators for built-in types, but enumerations are, technically, user-defined types. Therefore you can overload input/output operators for them.) This proof of conceptapplication will help show your programming team that the bridge game you are designing can accept bids directly from the player without having to rely on a clumsy menu interface. An example program interaction might look something like this: $ ./suitenter.out Welcome to the Card Suit Entering Program!!! What is the suit of your card? hearts You have a heart! Don't wear it on your sleeve..! Another card? y What is the suit of your card? s So, you have a spade! Dig me a hole out back, won't you?…