|
-
how to write the calculation of this
RAM:
RAM is available in the units of 64Mb or 128Mb. The user may choose either
64Mb or 128Mb or 192Mb or 256Mb as the total RAM for the PC Box. Any other
value entered by the user is not to be accepted. If the user requires 192Mb
to RAM then three units of 64Mb must be used. If the user requires 256Mb
total RAM then two units of 128Mb must be used. If the total RAM chosen by
the user is either 64Mb or 128Mb then a single unit of the appropriate size
must be used. The price of RAM is calculated at the rate of Dhs 200 per
64Mb.
1.2.Define a sub class called RAM that will extend Hardware.
This class will have additional private data member called size.
A non-default constructor that will get the value of size as a parameter
and set its value accordingly.
Override the method calcPrice() so that the price of RAM is calculated
as per the guideline given earlier (i.e. for every 64Mb, Dhs 200 will be
charged).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks