Designer Door Mat Python
Mr. Vincent works in a door mat manufacturing company. One day, he designed a new door mat with the following specifications: 1. Mat size must be MXN. (N is an odd natural number, and M is 3 times N.) 2. The design should have 'WELCOME' written in the center. 3. The design pattern should only use |, . and - characters. Sample Designs: Size: 7 x 21 ---------.|.--------- ------.|..|..|.------ ---.|..|..|..|..|.--- -------WELCOME------- ---
View Solution →Deque-STL C++
Double ended queue or Deque(part of C++ STL) are sequence containers with dynamic sizes that can be expanded or contracted on both ends (either its front or its back). The member functions of deque that are mainly used are: Deque Template: std::deque<value_type> Declaration: deque<int> mydeque; //Creates a double ended queue of deque of int type Size int length = mydeque.size(); //Gives the size of the deque Push mydeque.push_back(1); //Pus
View Solution →Inheritance Introduction c++
One of the important topics of Object Oriented Programming is Inheritance. Inheritance allows us to define a class in terms of another class, which allows us in the reusability of the code.Check out the code below: class Triangle{ public: void triangle(){ cout<<"I am a triangle\n"; } }; The class Triangle has a function called triangle(). Now we create a class derived from the base class Triangle called Isosceles. class Isosceles : public Triangle{
View Solution →Alphabet Rangoli Python
You are given an integer, N. Your task is to print an alphabet rangoli of size N. (Rangoli is a form of Indian folk art based on creation of patterns.) Different sizes of alphabet rangoli are shown below: #size 3 ----c---- --c-b-c-- c-b-a-b-c --c-b-c-- ----c---- #size 5 --------e-------- ------e-d-e------ ----e-d-c-d-e---- --e-d-c-b-c-d-e-- e-d-c-b-a-b-c-d-e --e-d-c-b-c-d-e-- ----e-d-c-d-e---- ------e-d-e------ --------e-------- #size 10 ------------------j------
View Solution →Rectangle Area C++
In this challenge, you are required to compute the area of a rectangle using classes. Create two classes: Rectangle The Rectangle class should have two data fields-width and height of int types. The class should have display() method, to print the width and height of the rectangle separated by space. RectangleArea The RectangleArea class is derived from Rectangle class, i.e., it is the sub-class of Rectangle class. The class should have read_input() method, to read the values of w
View Solution →