473,387 Members | 1,553 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,387 software developers and data experts.

Can any one solve this Problem

Can any one Solve this Probelm? Having some problems Thanks

1) Create a class with three or more private instance variables. Please create a class for something other than dates.

(2) Create in this class set (mutator) methods for each instance variable that perform checks for valid input.

(3) Create in this class get (accessor) methods for each instance variable.

(4) Create 3 or more constructors for this class. The constructors should utilize the set methods to perform checks for valid input.

(5) Create a toString() method to display the values of the instance variables in a suitable form.

(6) Create another class which utilizes the class you created in steps 1-5. This class should

-instantiate 2 objects, one of which should utilize some default values

-display the values of the instance variables of these objects using the toString() method

-use the mutator methods to reset the values of one of the objects and then display the new values using the toString() method
Mar 20 '08 #1
2 1093
JosAH
11,448 Expert 8TB
Great! Let's go for it; what did you do already?

kind regards,

Jos
Mar 20 '08 #2
sukatoa
539 512MB
Can any one Solve this Probelm? Having some problems Thanks

1) Create a class with three or more private instance variables. Please create a class for something other than dates.

(2) Create in this class set (mutator) methods for each instance variable that perform checks for valid input.

(3) Create in this class get (accessor) methods for each instance variable.

(4) Create 3 or more constructors for this class. The constructors should utilize the set methods to perform checks for valid input.

(5) Create a toString() method to display the values of the instance variables in a suitable form.

(6) Create another class which utilizes the class you created in steps 1-5. This class should

-instantiate 2 objects, one of which should utilize some default values

-display the values of the instance variables of these objects using the toString() method

-use the mutator methods to reset the values of one of the objects and then display the new values using the toString() method
You can surf it on the web...

Posting a complete code for you is restricted on this Site...

Our experts here are happy to help/assists you than to post the whole codes...

Just ask a specific question with your best effort..."Show what you have done"

Maybe this was your assignment i guess, ;-)

Sukatoa
Mar 20 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: BVM | last post by:
Hi, All: I have this error. It seems execution time is too long. Actually the execution time is about 30 seconds(I tested in Query analyzer). How do I solve this problem? ...
3
by: Alex | last post by:
Hi, I have a problem involving some design issue. I have two unrelated (that is, they do not derive from the same base) classes: ClassA ClassB Both have a quite similar interface, so they can...
7
by: Shapper | last post by:
Hello, I have an ASP:ImageButton where I want to call a function and pass a string: OnClick="Change_Photo("John")" I am having problems with "". I tried
6
by: Federico | last post by:
Hi, this is what I can do: - Create new solutions using VS.Net ASP.Net - Save the solutions, build the solution, view in browser with the solution still open. But, once I close the solution, I...
0
by: Jitesh | last post by:
I am facing a problem in webservice, I want to know what will be the exact procedure to solve the problem............. What I want to do............ I have a table named order in SQL Server....
27
by: John Salerno | last post by:
Ok, here's a problem I've sort of assigned to myself for fun, but it's turning out to be quite a pain to wrap my mind around. It's from a puzzle game. It will help if you look at this image: ...
8
by: vj | last post by:
Hi all, I want to solve the two equations u*tan(u)=w and u^2 + w^2=V^2, where V is a known constant, and u and w are the two unknowns to be determined. Please can someone suggest me how to...
1
by: arun | last post by:
Query is too complex -------------------------------------------------------------------------------- Hi, I was trying to solve this problem since last two days but couldn't find any solution. ...
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
2
by: itsvineeth209 | last post by:
My task is to create login control without using login control in tools. I shouldnt use sqldatasource or any other. I should use only data sets, data adapters and data readers etc. U had created...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.