A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable. Classes are generally declared using the keyword class, with the following format: class class_name { access_specifier_1: member1; access_specifier_2: member2; ... } object_names; Where class_name is a valid identifier for the class, object_names is an optional list of names for objects of this class. The body of the declaration can contain members, that can be either data or function declarations, and optionally access specifiers.
1. Save classFraction in a file called classFraction.cpp. 2. Write the main function in a file called fractionExercises.cpp. You access class Fraction through the statement: #include “classFraction.cpp”. The main function consists of a do while loop that displays the following menu: ************************************* What type of exercise would you like to see? +, -, * , or / ************************************* The user enters their choice (+, -, * , or /) into a variable named choice. If choice is ‘*’, then a function called multFraction() is called. This function is not part of class Fraction. It is found in the same file as the main function. Function multFraction() generates a random multiplication exercise. Use: srand(time(0)), and rand()%15+1, to generate random integers between 1 and 15. Functions srand and rand are found in stdlib.
Okay! And after that what do u want to do????? And, just a personal question....if u dont mind me asking your nationality...i mean where do u live?
DO NOT post duplicate threads please. One thread per subject. http://www.go4expert.com/showthread.php?t=25791