Overload unary minus operator to make data members negative


Question 1) Write a program that merges two input files ”Data1” and “Data2” giving the third output file“Dataf”. The 2 input files contain records in ascending order of their roll numbers and resultant file should also be in ascending order. Write this program using

• Without using structures / classes

• structures

• classes

Question 2) A binary file “Employee.dat” containing Empno, Wrate( hourly wage rate), Noh(number of hours worked / week) fields. Write a C++ function to read each record, compute weekly wage as Write * Noh and display Empno, Wrate, Noh, Wrate*Noh.

Question 3) Write a program to check a C++ program for matching characters ({ }, ( ), /* */) and display whether they are well formed or not.

Question 4) Write a program to read a binary file “Emp.dat” using classes and display only those records whose salary is between 10000 and 20000 and job is “Manager”

Question 5) Write a program which reads one line at a time from the disk file “TRY.TXT” and display it on the monitor. The maximum length of the line is 80 characters.

Question 6) Write a program to write the contents of a string variable one character at a time to the disk file OUT.TXT.

Question 7) Overload unary minus(-) operator to make data members inside the structure /class negative.

• Using structure

• Using class (member functions)

• Using class (friend function)

Question 8) Overload “++” and “- -“ operator.

• Using structure

• Using classes (member functions)

• Using classes (friend functions)

Question 9) Overload ‘+’ operator to add two complex numbers.

• Using structure

• Using class (member function)

• Using class (friend function)

Question 10) Overload ‘+’ and ‘*’ operator to add and multiply two matrices.

• Using structure

• Using class (member function)

• Using class (friend function)

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Overload unary minus operator to make data members negative
Reference No:- TGS04925

Expected delivery within 24 Hours