cannot compile this program please correct it i

M

mohammaditraders

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

Question # 2

What is function overloading Is it possible to overload constructor if
Yes give complete example of constructor overloading, if No justify
your answer.
 
V

Victor Bazarov

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

Question # 2

What is function overloading Is it possible to overload constructor if
Yes give complete example of constructor overloading, if No justify
your answer.

The subject states "cannot compile this program please correct it i".
Ignoring the 'i' at the end (which might mean it's part one or smth),
I still am unable to understand what you're asking. There is *NO*
program in your message for us to correct. Please post your code.

Also, check out FAQ section 5.

V
 
Z

Zeppe

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

Question # 2

What is function overloading Is it possible to overload constructor if
Yes give complete example of constructor overloading, if No justify
your answer.

Lol, James, you were right! He's back! lol!

Regards,

Zeppe
 
R

red floyd

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

Question # 2

What is function overloading Is it possible to overload constructor if
Yes give complete example of constructor overloading, if No justify
your answer.
Your problem is a FAQ. Please FAQ 5.2,
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
 
O

osmium

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

I think you need a better dictionary to translate between English and your
native language. In particular, find out what the word "this" means.

Unfortunately, the answer to your question has been posted in bits and
pieces during the last few days. It is now up tot you either write a
program or fit the bits and pieces together, which means deciding which bits
to keep, which to discard, which to modify and so on. After you have
assembled something you like (or can live with), compile and run it. If
you have problems, embed the entire body of code in a message to the
newsgroup along with a question. Embed means cut and paste.
 
J

Jim Langston

Question # 1 Write a program which consists of a class
named Student, the class should consists of three data members Name,
Ob_marks, Total_marks and two member functions Cal_percentage() which
calculate the percentage of the student by the formula (Ob_marks *
100 )/Total_marks and Display() which show all information of the
student. The class should also contain the default constructor which
initializes all the data member of the class.
In main program define an object of the Student class and call the
member functions with this object.

Question # 2

What is function overloading Is it possible to overload constructor if
Yes give complete example of constructor overloading, if No justify
your answer.

#include <string>

int main()
{
std::string Text = " Question # 1 Write a program which
consists of a class\
named Student, the class should consists of three data members Name,\
Ob_marks, Total_marks and two member functions Cal_percentage() which\
calculate the percentage of the student by the formula (Ob_marks *\
100 )/Total_marks and Display() which show all information of the\
student. The class should also contain the default constructor which\
initializes all the data member of the class.\
In main program define an object of the Student class and call the\
member functions with this object.\
\
Question # 2\
\
What is function overloading Is it possible to overload constructor if\
Yes give complete example of constructor overloading, if No justify\
your answer.";
}

That should fix your typos.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top