i'm so frustrated about my coding :( now i cant even get it right :(
assignment gonna due this coming week T^T
and i really need help
i hope you guys can really solve my problem for me T^T
so here is what i did so far ><
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;
public class Auction
{
private int displayPrice;
private int increase;
private int decrease;
private ArrayList<String> profile;
private int BidPriceRangeNew;
private int BidPriceRangeOld;
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)
{
int aInt = Integer.parseInt(line);
System.out.println(line);
}
}catch(Exception e)
{
e.printStackTrace();
}
}
public void setDisplayPrice(int newDisplayPrice)
{
displayPrice = newDisplayPrice;
}
public int getDisplay()
{
return displayPrice;
}
public void increment(int increase)
{
increase++;
}
public void decrement(int decrease)
{
decrease--;
}
}
there would be a file that is called "property.txt" to read
and inside the .txt file it contains
1-100=1
101-200=2
201-300=3
301-400=4
how am i suppose to let my program know that my displayPrice is in that range so that the increment value is according to the range of value?
for example: if my displayPrice is 90 means after i read the file,
i have to know that my displayPrice will increase next to