Write a C++ program that creates a 2D array having 4 rows and 4 columns. Then, ask the user to input values for the 2D array or matrix. After that, the program should calculate transpose of a matrix. Transpose is basically calculated by changing rows of matrix into columns and columns into rows. After calculating, display the final matrix?
Write a program to take input for n book records from user and write those book records in a file named: ”record”, whose price is less than INR 500 . Program should also perform random access in the file, after taking input for a particular record number to read and it should also perform random record overwriting after taking input of new record and the record number to overwrite. After overwriting record, display all records on the screen. [Attributes of book: Book_id, Book_price, Book_name, Book_author_name]
Write a program to perform class to basic conversion [such as : class is : Triangle with data members base and height (float), and basic type is float(area of triangle)].
Write a program to overload operators in the same program by writing suitable operator friend function for following expression.
O7=((O1>=O2)+(O3&&O4) *(O5<O6)) [here O1,O2,O3,O4,O5,O6 and O7 are object of a class ''overloading", and this class is having one integer data member]
Explain the difference between constructor and initializer list.
Write a program to take input for n book records from user and write those book records in a file named: ”record”, whose price is less than INR 500 . Program should also perform random access in the file, after taking input for a particular record number to read and it should also perform random record overwriting after taking input of new record and the record number to overwrite. After overwriting record, display all records on the screen [Attributes of book: Book_id, Book_price, Book_name, Book_author_name]
Write a program to take input for n book records from user and write those book records in a file named: ”record”, whose price is less than INR 500 . Program should also perform random access in the file, after taking input for a particular record number to read and it should also perform random record overwriting after taking input of new record and the record number to overwrite. After overwriting record, display all records on the screen [Attributes of book: Book_id, Book_price, Book_name, Book_author_name]
Write a program to take input for n number of doctor records and write records of all cardiologists in
a file named: “record1”. Also write records of all those doctors in another file named: “record2” who are
taking salary more than INR 80,000. After writing records in both files, merge their contents in another
file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of doctor:
doc_id, doc_name, doc_specialization, doc_salary]
Discuss constructors with default arguments and constructor overloading with the help of suitable
examples.
Q2: Write a program to overload operators in the same program by writing suitable operator member
functions for following expression:
O7= ((O1 % O2)>(O3 || O4) - (O5>O6)) [Here O1,O2,O3,O4,O5,O6 and O7 are objects of a class
“overloading”, and this class is having one integer data member]