473,385 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

cannot compile this program please correct it i

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.

Jun 14 '07 #1
5 2177
mo**************@gmail.com wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 14 '07 #2
mo**************@gmail.com wrote:
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
Jun 14 '07 #3
mo**************@gmail.com wrote:
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-lit...t.html#faq-5.2
Jun 14 '07 #4
<mo**************@gmail.comwrote:
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.
Jun 14 '07 #5

<mo**************@gmail.comwrote in message
news:11*********************@d30g2000prg.googlegro ups.com...
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.
Jun 15 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Cristian Soto | last post by:
Hi! Could someone please compile this programm for a win32 system and send the exe-file to my email adress crisoto@hotmail.com? For the time I don't have access to a computer wih a compiler and...
3
by: Firstname Lastname | last post by:
In a function call, for example function(Class(), &Class::memfunc), my compiler cannot match the 2nd argument when: (1) Class is a template parameter, and (2) the base class of Class defines...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
3
by: | last post by:
I am trying to compile a simple c# class in Web Matrix called howdy.cs: // Program start class public class HowdyPartner { // Main begins program execution public static void Main() { //...
11
by: Chris Dams | last post by:
Dear all, I found out that the program #include<vector> using namespace std; int main() { vector<int*> v(2,0);
2
by: Christophe | last post by:
class A {} class B {} interface MyInterface { void method(A a); void method(B b); }
13
by: hn.ft.pris | last post by:
Hi: I have the following simple program: #include<iostream> using namespace std; int main(int argc, char* argv){ const double L = 1.234; const int T = static_cast<const int>(L); int arr;
2
by: wong_powah | last post by:
#include <vector> #include <iostream> using std::cout; using std::vector; enum {DATASIZE = 20}; typedef unsigned char data_t;
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.