#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    2
    Rep Power
    0

    Why aren't javadocs being generated?


    [bluejay10 here having forgetten his password and not having recieved a reset password message yet -_-.Had to make a new account b/c of my questions relative urgency,I'll delete this one ASAP]


    http://sidetrack1.deviantart.com/art/Javadocs-Not-Generated-353650496?ga_submit_new=10%253A1360562461

    Here's the code for the things that need javadocs

    Code:
    import java.util.Scanner;
    
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /**
     *
     * @author ufe-c122-pc05
     */
    public class Lab2 {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) 
        {
            
            Scanner input = new Scanner(System.in);
            System.out.print ("enter first numerator ");
            int num1 = input.nextInt();//take in next input
            int denom1=0;//initilize denominator to zero
            while (denom1 == 0) //set a determined condition for so long as there is no input
            {
                System.out.print ("enter first denominator "); //prompt for input of a denominator
                denom1 = input.nextInt();//input for next denominator   
            } 
            System.out.print ("enter second numerator " );//prompt for another numerator
            int num2 = input.nextInt();//for accepting the next numerical input
            int denom2=0;//denominator condition set to zero
            while (denom2 == 0) //set a determined condition for so long as there is no input for the second denominator
            {
                System.out.print ("enter second denominator " );//display the prompt message
                denom2 = input.nextInt();//
            }
            Fraction firstfrac = new Fraction(num1,denom1); //this creates an object using the first fraction class
            Fraction secndfrac = new Fraction (num2,denom2);//this creates an object using the second fraction class
             
            firstfrac.display();//display first fraction
            secndfrac.display();//display second fraction
    
            int denomsum=firstfrac.getDenominator()*secndfrac.getDenominator() ;
            int numersum=(firstfrac.getNumerator()*secndfrac.getDenominator())
                         +(secndfrac.getNumerator()*firstfrac.getDenominator());
           
            Fraction sumfrac=new Fraction(numersum,denomsum);
            System.out.print("The sum of both fractions is ");
            sumfrac.display();
        }
    }
    and

    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /**
     *
     * @author ufe-c122-pc05
     */
    public class Fraction {
        
        private int numerator;
        private int denominator;
        
        
        // constructor
        public Fraction (int num,int denom)//set the fraction to have the numerator and denominator variables
        {
            numerator=num; //numerator variable declared
            denominator=denom; //denominator variable declared
            reduce();
        } 
         
        public void display()//a public variable that can be accesed by Lab2
        {
            System.out.printf("%d / %d\n",numerator, denominator); //print out message stating input fraction parts
        }
         
    //    public void add()
    //    {
    //     
    //    }
         
        public int getNumerator()
        {
            return numerator; //display input numerator
        }
         
        public int getDenominator()
        {
            return denominator;//display input denominator
        }
        
        private void reduce()
        {
            //integer variable to be the gcd 
            int cd=findGCD();
            //find the greatest common divider
            
            // numerator/=cd; short form
            numerator=numerator/cd;
            denominator=denominator/cd;
        }
        
        private int findGCD()//to find the greatest multiple for the inputs
        {
            //declare private numerator and denominator
            int num=numerator; 
            int denom=denominator;
            
            if(denom==0)//in case the fraction is undefined
                {
                return num;
                } 
            while (denom>0){
            int tmp=num;
            num=denom;
            denom=tmp%num;
            }
            return num;//for displaying the divider
        }
       
    }
  2. #2
  3. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,553
    Rep Power
    1621

    Javadoc


    How did you invoke the javadoc tool to generate javadoc comments?
    When the programming world turns decent, the real world will turn upside down.

IMN logo majestic logo threadwatch logo seochat tools logo