473,397 Members | 2,033 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,397 software developers and data experts.

Change os source- reformulating

I have this sub class that I need to reformulate ..change the source
but the action(result) should be the same.
Can someone reformulate this source code for me?
I would greatly appreciate
Thanks a lot !


class student:public person{ //Seudent inherits form Class person
private:

int studentNo;

public:
/*Student contructor*/
student(char *sn, char *gn, char *addr, char *bDay, int sNo)
:person(sn,gn,addr,bDay){
studentNo=sNo;
}
void showStudentNo(){
cout<<"Sudent No: "<<studentNo<<endl;
}
};
Jul 19 '05 #1
3 1290
Hi Constant,
class student:public person{ //Seudent inherits form Class person
private:

int studentNo;

public:
/*Student contructor*/
student(char *sn, char *gn, char *addr, char *bDay, int sNo)
:person(sn,gn,addr,bDay){
studentNo=sNo;
}
Here you should ask your theacher why the constructor call is not like:

stundent(const string &,const string &,const string &,const string &,const
int&);

it must be a very old program which is extended now.
void showStudentNo(){
cout<<"Sudent No: "<<studentNo<<endl;
}


Since I assume that you did not introduce a global "using namespace std" it
should be

std::cout << "Student No: " << studentNo << std::endl:

Regards,
Patrick
Jul 19 '05 #2


Constant wrote:

I have this sub class that I need to reformulate ..change the source
but the action(result) should be the same.
Can someone reformulate this source code for me?


Well. If you tell us what you don't like about it.
There are some things like: switching completely to
initializer lists, using std::string instead of char*,
using namespace std.
But I'm sure you can do all of this changes by yourself,
they are trivial to do.

So what is it, that you want to be changed?

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #3

"Constant" <co*******@yahoo.com> wrote in message
news:5c**************************@posting.google.c om...
I have this sub class that I need to reformulate ..change the source
but the action(result) should be the same.
Can someone reformulate this source code for me?
I would greatly appreciate
Thanks a lot !


class student:public person{ //Seudent inherits form Class person
private:

int studentNo;

public:
/*Student contructor*/
student(char *sn, char *gn, char *addr, char *bDay, int sNo)
:person(sn,gn,addr,bDay){
studentNo=sNo;
}
void showStudentNo(){
cout<<"Sudent No: "<<studentNo<<endl;
}
};


Reformulated? What do you want changed? Let me guess...given your other
question was asking to get your homework solved for you, what you want here
is to change this code around so that it looks like YOU wrote it, instead of
it being exactly like someone else's (who you "borrowed" it from)? I'd say
you should do your own homework and come back here when you actually need
real help, not when you want to cheat!
-Howard


Jul 19 '05 #4

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

Similar topics

12
by: Markus.Elfring | last post by:
I am interested to know if the pointer value for the memory address can be changed by a compiler if the constness of the corresponding type is cast away. inline char* deconstify1(char const * X)...
6
by: Dovelet | last post by:
Hi all, I would like to write DOS program to change the MS Windows Sound Recording source. When I run it with the parameter, it will change the recording source as follow: C:\> abc.exe...
4
by: argniw | last post by:
I have a number of OBDC connections to SQL server tables in my access database. I want to change the data source for each of the links at once. With the linked table manager you can only change...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
2
by: Pieter | last post by:
Hi, I'm using the Settings.settings of VB.NET to define a Connectionstring (Scope = application). When I deploy the Solution, and change this Setting in the app.config-file, it seems that...
4
by: steph | last post by:
Hi, A question regarding Access 2002: I've got a form which should be displayed in Form View and in Datasheet View. But I want to use a different record source for each view. That means, when...
3
by: Dave Smithz | last post by:
Hi there, Summary: I'm looking for a good open source, Windows Change control program. What are people using for there PHP projects? Is there a clear leader for this? Can programs like MS...
1
by: Simon | last post by:
Dear reader, My SubReport is synchronized with a LinkMasterField and LinkChildField. If I put in the Open event of the SubReport Me.RecordSource = "QueryName" an error pups up. It seems to...
25
by: Peng Yu | last post by:
Hi, It is possible to change the length of "\t" to a number other than 8. std::cout << "\t"; Thanks, Peng
3
by: Simon van Beek | last post by:
Dear reader, How to change the RecordSource for a subReport. For forms the syntaxes is:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.