State the sylvester's law of inertia.
Create a class motorcycle that contains the following attributes: The name of motorcycle, the direction of motorcycle (E, W, N, S) and the position of motorcycle (from imaginary zero point) The class has following member functions: A constructor to initialize the attributes, Turn function to change direction of the motorcycle to one step right side. Overload the turn function to change the direction to any side directly. It should accept the direction as parameter. More function to change the position of motorcycle away from zero point. It should accept the distance as parameter
Write a c++ program that makes a dynamic array and uses an integer to checks its size. Enter numbers in it until the user presses 4. Create another array and copy the contents of first array into the new array and delete the memory of 1st array. Also print as you insert the values.
Create a class BookData having following members:
private Book book[ ] – Array of type Book
private int index
public void setBook(int bookNo, String title, String publication, String author, float price, String type)
method should create an object at index position starting from 0. public void printBooks( ) – method to print all book details in an array
public String searchByNo ( int bookNo ) – method to return book details of
book whose book no passed as parameter
public String searchByAuthor ( String author ) – method to return all book
names of an author whose name passed as parameter
Create a class Computer derived from Book having following members
private String type - It could be Networking, DataStructure, DBMS
Setter and getter method for type instance variable
Create a class Mathematics derived from Book having following members
private String type – It could be Algebra, Geometry
Setter and getter method for type instance variable
Create a class TestBook having main method. Create an object of Computer. Scan data from user, set and print details of Computer book. Create an object of Mathematics class. Scan data from user, set and print
details of Mathematics book.
Modify the TestBook class in above program. Create an array of Book type of
size 4. Store 2 Computer and 2 Mathematics books data in array and print all
book details.
Create a class with an integer data member. Include functions for input and output in class. Count the number of times each function is called and display it. It should be a user defined program.
Write a program to create a class 'A' with an integer data member. Create another class ' B' with one integer data.
Using friend class do the following,