DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2005

    Boolean vlaue for a video store program - please help!!


    Any idea how I can add a boolean method that will simply say whether a video is available or not. Such as, 'if' the video is available return true, 'else' return false.

    I have to admit I'm pretty useless with boolean statements and would appreciate any advice.

    The program is a simple Video store management program. My current code is as follows,

    package videos;
    public class Video {
        private int days, referenceNumber;
        private static double dailyPrice;
        private double totalPrice;
        private Title videoTitle;
        public Video(int refNum, Title t, int d, double dp) {
            referenceNumber = refNum; videoTitle = t; days = d; dailyPrice = dp;
        public Video(int title, String film, String lead1, String lead2, String dir){
            videoTitle = new Title(title, film, lead1, lead2, dir);
        public Title getTitle() {
            return videoTitle;
        public int getReferenceNumber() {
            return referenceNumber;
        public void setReferenceNumber(int refNum) {
            referenceNumber = refNum;
        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 double getTotalPrice() {
            return totalPrice;
        public void ApplyTotalPrice() {
            totalPrice = days*dailyPrice;
        public String toString() {
            return referenceNumber + "" + videoTitle + "" + totalPrice;
    Also, do you think the above method for calculating TotalPrice will work in this class?

    Any help appreciated!!

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    have a data member to your class which is a boolean - available

    this member's value is returned by the method isAvailable().

    Any action relating to the check out, check in, etc. of the video would include a query to isAvailable().

    if (isAvailable() )
    System.out.println( "Sorry, this title is not available. Choose another." );

    or something like that ....

Similar Threads

  1. capturing and dumping video streaming via http
    By Zingaro2002 in forum .NET
    Replies: 0
    Last Post: 10-07-2005, 12:03 PM
  2. How long before the next version??
    By _CAG in forum .NET
    Replies: 146
    Last Post: 08-12-2002, 10:40 PM
  3. Re: App Object (fixes)
    By Rob Teixeira in forum .NET
    Replies: 129
    Last Post: 06-06-2002, 05:23 AM
  4. Object Array ? Do you Worth it
    By ashish in forum Java
    Replies: 1
    Last Post: 05-23-2002, 07:50 AM
  5. Please help with running executable vb program.
    By Gordon Reichhardt in forum VB Classic
    Replies: 2
    Last Post: 01-08-2002, 10:06 AM

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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.