0
import java.util.ArrayList;
import java.util.Scanner;
import java.io.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;



    
/**
 * Write a description of class Auction here.
 * 
 * @Bong Suk Ing
 * @20/10/2011
 */
public class Auction
{

    private int displayPrice;
    private int increase;
    private int decrease;
    private ArrayList<String> profile; 
    private int BidPriceRangeNew;
    private int BidPriceRangeOld;
    private int [] maxValues;
    private int [] minValues;
    private int [] addValues;
    private int count = 0;


    
    
    public Auction()
    {
        profile = new ArrayList<String>();
    }
    
    public void propertyReadFromFile()
    {
        /**
         * Read datas from Property.txt
         */
        
    
        try
        {
         BufferedReader reader = new BufferedReader(new FileReader("property.txt"));
         String line = null;
          
              while ((line = reader.readLine()) != null){
                  String[] tempString ;
                  tempString = line.split("-");
                  int numb = Integer.parseInt(tempString[0]);
                  minValues[count] = numb;
                  tempString = tempString[1].split("=");
                  int numb1 = Integer.parseInt(tempString[0]);
                  maxValues[count] = numb1;
                  int numb2 = Integer.parseInt(tempString[1]); 
                  addValues[count] = numb2;
                  count ++;
            }
        }catch(Exception e)
        {
            e.printStackTrace();
        }
      
    }
    
public void setDisplayPrice(int newDisplayPrice)
{  
    displayPrice = newDisplayPrice;
}

public int getDisplay()
{
    return displayPrice;
}

public int increment(int increase)
{
    increase++;
    return increase;
}

public void decrement(int decrease)
{
    decrease--;
}

}

can anyone help me with whr to ask the user to input the displayPrice? then how to detect it which range it is? ><
and how to create the main for it to work ?
help with the coding k? guys :(
thanks alot!

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by stultuske
0

where to ask for input: that would depend on where YOU want he input.
detect in which range it is .. use the operators <, = and > and you'll have it to work in no time.

creating a main method is the very most basic thing in Java. you wouldn't even be able to get a 'HelloWorld' class to say 'Hello' without one, so I'm sure you'll have an example somewhere.

This looks a lot like you've just copied your assignment here, while we're not here to do your homework for you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.