Write a program to create a base class: “Question3”, with protected data member: x (int) and
with pure virtual function: “Task ()” [Returns no value and takes no argument]. Create a derived
class of “Question3” such as “Sub1” (Derive features in public mode). In sub1, there is a
member function in public section: get_data1 () to take input for x, and define Task () in this
class to display the reverse of x. [Implement the above program by creating pointer to base in
main () function and call the necessary functions].
write a program to implement run time polymorphism. Take a function check() in base class. Redefine the function in derived classes. One will calculate factorial of a number. Other will display multiplication table of that number.
Write a console application that prints the next 20 leap years. A leap year is a year in
which an extra day is added to the Gregorian calendar, which is used by most of the
world. While an ordinary year has 365 days, a leap year has 366 days. ... A leap year
comes once every four years. Because of this, a leap year can always be evenly
divided by four
The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number.
Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type.
Each one the arrays corresponds to a row of the magic square.
The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not.
Use the following template to start your project:
#include<iostream>
using namespace std;
// Global constants
const int ROWS = 3; // The number of rows in the array
const int COLS = 3; // The number of columns in the array
const int MIN = 1; // The value of the smallest number
const int MAX = 9; // The value of the largest number
write vb code to calculate the number of dozens and number of eggs remaining from a total number of eggs
property tax is calculated as 1,56% of the asset value of a property. program to accept the asset valuec750,00000 and calculate and display the property tax
a patron needs an application to calculate the tip and final bill amount for a restaurant bill. accept the bill amount 129,50 and tip percentage 10%.
calculate the tip amount and final bill of the patron and then display it
: Overlapping rectangles – A rectangle is identified by its four coordinates, Make a structure to hold data for every rectangle, there is bare minimum information that
you to store for each rectangle i.e. its coordinates. You can also improvise and make additional members
in the structure if you think it will help in doing any of the following tasks. Write the following functions:
1. Generate n number of rectangles
2. Find and return the area of all the rectangles, given the rectangles in the above format
3. Sort and return all rectangles in the ascending order based on their area.
4. Find the set of rectangles that overlap the largest rectangle
5. Write a function main (as a controller) to call the above functions in the correct order to identify
the set of rectangles that overlap the largest rectangle
an egg distributor has an application to calculate the number of dozens 2 and number of eggs remaining 6 from a total number of eggs 30
Design an algorithm that asks for the radius of two
circles. The algorithm should tell the user which circle has the greater area, or whether the areas
are the same.