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]
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 Note: (solve without vectors)
Discuss constructors with default arguments and constructor overloading with the help of suitable examples.
Write a program to overload operators in the same program by writing suitable operator member functions for following expression:
07= ((01 % 02) (03 || 04) - (05>06)) [Here 01,02,03,04,05,06 and 07 are objects of a class "overloading", and this class is having one integer data member]