Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > C++

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-31-2009, 03:59 PM
raz raz is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
how to write this program in c++?

hello, i need ur help..



at least i need to know how to begin with it.


define a CLASS PERSON TYPE that does:

a. set the first name only.

b. set the last name only.

c. store and set the middle name.

d. check whether a given first name is the same as the first name of this person.

e.check whether a given first name is the same as the first name of this person,

write the definition of the member function to implement the operations for this class.also, write a program to test various operations on this class.
Reply With Quote
  #2  
Old 10-31-2009, 09:08 PM
hendrixj hendrixj is offline
Registered User
 
Join Date: Oct 2007
Posts: 240
Simply think in terms of objects that have "state" and "behavior"
- What is the relevant state of a Person in your problem?
- What behavior does your person have?
Reply With Quote
  #3  
Old 11-01-2009, 08:30 AM
sypress's Avatar
sypress sypress is offline
Registered User
 
Join Date: Apr 2008
Location: Finland
Posts: 51
Here is a beginning:

Code:
#include <iostream>
#include <string>
using namespace std;
class PERSON
{
private:
	string firstname;
public:
	void setFirstname();
};
void main()
{
	PERSON object;	
	object.setFirstname();
}
void PERSON::setFirstname()
{
	cout << "Give firstname" << endl;
	cin >> firstname;
}
__________________
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Closed program stays running in RAM DGardner37 .NET 7 12-03-2008 10:34 AM
help write screen saver program in VS.Net that shows computer playing ping pong irinka1978 .NET 4 09-24-2008 09:57 AM
Help with Server program sedricbenson@ho C++ 2 11-07-2006 09:18 AM
Help! Write a program to compute easter sunday t0n3dawgg Java 2 10-10-2006 02:03 AM
Help with a program stormswimmer Java 2 01-02-2006 04:17 PM


All times are GMT -4. The time now is 01:48 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.