C++ PROGRAMMING EXERCISES
1)
Define a class Distance with feet and inch declared in private section and with a print function in public section to print the distance. Write a non-member function max which returns the larger of two distance objects, which are arguments. Write a main program that accepts two distance objects from the user, compare them and display the larger.
Define a class Distance with feet and inch declared in private section and with a print function in public section to print the distance. Write a non-member function max which returns the larger of two distance objects, which are arguments. Write a main program that accepts two distance objects from the user, compare them and display the larger.
sample code:
2)
write a c++ code to open a file and print the following data into the file in the same format as specified here(no need to fill colour's).
write a c++ code to open a file and print the following data into the file in the same format as specified here(no need to fill colour's).
******************************************************************************
* *
* ********************************* *
************************ CODERS HUNT ********************
*********************************
* *
* ********************************* *
************************ CODERS HUNT ********************
*********************************