Senin, 20 Februari 2012

C #

#include <iostraem>
using std::cout:
using std::endl:

#include<sting>//program user c++ standart string class
using std::string:
using std::getline:
//gradebook class definition
class gredabook
{
public:
    //function that display a welcome massage to the grade book user void displaymassage()
   {
   cout <<"welcome to the grade book!"<<endl:
   } //end function displaymassage
};//end classgradebook
//function main begins program execution
int main ()
{
    string nameofcourse;//string of character to store the course name
    gradebook mygradebook;//create a gradebook object named mygradebook

    //prompt for and input course name
   cout <<"please enter the course name:"<<endl:
   getline(ciin.nameofcourse); //read acourse name with blanks
   coout<<endl;

   //callmygradebook's displaymassage function
   //and pass nameofcourse as an argument
   mygradebook.displaymassage(nameofcourse);//object's displaymassage function
}
  

Tidak ada komentar:

Posting Komentar