DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005
    Posts
    44

    Video store program - persisting problems. Any advice !!

    Hi,

    I'm currently trying to write a basic video store management program. I have already written a number of classes to help do this job, but I'm having a few doubts about my Video class.

    Basically, will the following code allow me to access the information about video titles, stored in a seperate class called 'Title', and will the constructor 'Video' correctly read data from a text file for the other required information.

    I know these questions may seem a bit simple, but I'm getting really lost with this program.

    Code so far is as follows;

    Code:
    package videos;
     
    import simplejava.*;
     
    public class Video {
        
        private int days, referenceNumber;
        private static double dailyPrice;
        private double totalPrice;
        private Title title;
        public boolean available;
        
        public Video(int refNum, int d, double dp) {
            referenceNumber = refNum;
            days = d;
            dailyPrice = dp;
            this.title = title;
        }
        
        public Video(SimpleReader in) {
            this(in.readInt(), in.readInt(), in.readDouble()); 
        }
        
        public int getReferenceNumber() {
            return referenceNumber;
        }
        
        public int getDays() {
            return days;
        }
        
        public void setDays(int d) {
            days = d;
        }
        
        public double getDailyPrice() {
            return dailyPrice;
        }
        
        public void setDailyPrice(double dp) {
            dailyPrice = dp;
        }
        
        public void getTotalPrice() {
            totalPrice = days*dailyPrice;
        }
        
        public boolean isAvailable() {
            if (available)
                return true;
            else
                return false;
        }
        
        public String toString() {
            return referenceNumber + "" + title + "" + totalPrice + available;
        }
    }
    Any help or advice really appreciated!!

  2. #2
    Join Date
    Oct 2005
    Posts
    12
    We have the same project ..
    I didn't do it yet . I'll show you my plan in a couple of dayes

Similar Threads

  1. Advice For a Future Project
    By Howard Lesmeister in forum Architecture and Design
    Replies: 4
    Last Post: 08-02-2002, 06:29 PM
  2. advice for a future project
    By Dan Barclay in forum Talk to the Editors
    Replies: 2
    Last Post: 07-30-2002, 02:34 PM
  3. ASP program architectures -- advice needed
    By Dan Newman in forum ASP.NET
    Replies: 0
    Last Post: 12-12-2001, 05:20 PM
  4. Replies: 6
    Last Post: 04-10-2001, 05:12 PM
  5. Replies: 1
    Last Post: 02-10-2001, 12:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links