Print out the cube values of the numbers ranging from 1 to 20 (inclusive). However, if the number is divisible by either 3 or 5, do not include them in printing and proceed with the next numbers. Tip: When skipping through special values, make use of the keyword continue and put them inside a conditional statement.
Library Management
Build a Library Management page .
Image:https://assets.ccbp.in/frontend/content/dynamic-webapps/library-management-output-v1.gif
HTTP Requests & Responses
Background Image:
https://assets.ccbp.in/frontend/dynamic-webapps/book-search-bg.png
Example:
https://apis.ccbp.in/book-store?title=IndiaQuery ParameterValuetitleValue of the searchInput element. Example: India
It should pass test conditions:
When a value is provided in the HTML input element with id searchInput and Enter Key is pressed, an HTTP GET request should be made to the Books URL with the query parameter 'title' as the value of the searchInput element
When the HTTP GET request is successful, then the searchResults element should consist of HTML image elements with src attribute value as the value of key 'imageLink' and HTML paragraph elements with text content as the value of key 'author' from HTTP response
create two classes, first class ‘Point’ with two data
members x and y. Provide appropriate constructors, get, set or display methods.
Create the second class ‘Triangle’ with three points as its data members. Provide
appropriate constructors for this class and a display method which calls the display methods of points.
In the main function, declare three points and pass them to the constructor of an instance of the triangle class and pass direct values to the second instance of the triangle class without creating points instances. Call the display method of triangle to verify the coordinates of the triangle.
prototypes
Point():
void insertPoint(int, int):
void displayPoint(int):4. Triangle():
Triangle(Point, Point, Point):
Triangle(int, int, int, int, int, int):
void insertData():
void displayData():
NOTE: Define functions outside of the class using scope resolution operator except
constructors and destructors.
You are required to create a class for dealing with complex numbers. In this particular
example we are only applying two arithmetic operations over complex number – addition
and subtraction. In complex numbers, we treat the real and imaginary part separately. You
need to define a constant char and assign it ‘i’, indicating the imaginary part. Also declare
two variables for denoting the real part and coefficient of the imaginary part. Define the
appropriate constructors, getters, setters and destructor as per the requirements.
You are required to create an object passing 2 arguments to its constructor, another
constant object with 2 arguments to its constructor. Add them both and store the resultant
object in a third instance by using the concept of copy constructor. Following are the
function prototypes,
Complex()
Complex(int, int)
Complex add(Complex)
void display()
void display() const
You are required to create a class by the name of ‘Matrix’. The matrix private domain must
contain a 2-Dimentional array of floats. The constructor should initialize a passed value to all the locations of the array being created and if the argument is missing, it should assign 0 by default to the entire array. Define appropriate functions for inserting data into the matrix and displaying the array in a matrix form. You need to define a function by the name of ‘dot’ that would take a matrix object as an argument and would return the matrix object (temporary) to where it was called from. From where it was called, there it should assign the returned object to a new matrix class instance.
Matrix obj3=obj1.dot(obj2);
Call the display function from the new instance to see the result of two matrices multiplied.
NOTE: Define a function ’float retreive(int, int)’ where if two indices are
passed to it, it must return the value located at those locations.
A network is given as 190.28.0.0/16. Eight subnets are to be created.
(a)What will be the CIDR network prefix?
(b)Express last subnet in dotted decimal notation with mask.
(c) What is the maximum number of hosts in each subnet?
(d) What is the address range for hosts in second subnet?
(e) What is the subnet broadcast address for the first subnet?
Create a class by the name of ‘Product’. Create the following private members
name(String), price(Int) and quantity(Int). Define a parameter-less and a
parameterized constructor. Define the following two member functions outside the class,
void getData()
static void counter()
static int countProduct()
The class would contain a static int ‘totalProduct’, having initial value equal to zero.
Each time an instance of the product class is created, the ‘counter()’ should be called.
The ‘counter()’ increments the static member by 1 value. Suppose I create 5 products,
when I execute the following code it should display 5.
Product::totalProducts;
Two 8 bit numbers in a hexadecimal are 05 and 06. Obtain the checksum.
Create a 'Circle' class with having a static data member name 'radius' and two pointer
data members name 'circumference' and 'area' as private. Allocate memory to the
two pointers in both parameter-less and parameterized constructors - parameterized
constructor must take a single float argument for radius. Define a deep copy constructor for
the class. Note that the constructor should assign data as well as calculate 'area' and
'circumference' based on the formulae. Two other functions with return type float
must return the value 'circumference' and 'area' are holding. Get rid of the
allocated space in destructor.
Write a program in C++ to find the largest and smallest of N numbers of any data type (use function overloading). The value of N is available only at the time of execution