Results 1 to 2 of 2
- 02-07-2011, 04:28 AM #1
Member
- Join Date
- Feb 2011
- Posts
- 1
- Rep Power
- 0
How to implement boolen in this arraylist problems?
Complete the class House and HouseApp below to display
class House{
int lotNo;
String type; //Bungalow, SemiDetached
double price;
public House ( int l, String t, double p) { }
public int theLotN() { }
public String theType(){ }
public double thePrice() { }
public void setPrice(double p) { }
}
public class HouseApp{
public static void main(String []args){
// declare two ArrayList named listHouse1 and listHouse2
int lt;
String tp;
double pc;
// prompt user to insert 4 houses information into the ArrayList
// display the houses information using the following format
//
// HOUSE IN TAMAN ILMU
// LOTNO TYPE PRICE
// . .
Use the information below as the program input:
HOUSES IN TAMAN ILMU
LotNo Type Price
10021 Bungalow 500,000.00
10022 Bungalow 700,000.00
10023 Semi Detached 450,000.00
10024 Semi Detached 300,000.00
Modify the coding to check for the price which is more than RM 450000. If it is fullfill the requirement:
i. remove it from the ArrayList
ii. calculate the new price for the house by deducting 30% discount off the original price and insert the house information into another ArrayList.
Display the houses information using the following format:
// HOUSE IN TAMAN ILMU LESS THAN RM450000
// LOTNO TYPE PRICE
// . .
// HOUSE IN TAMAN ILMU MORE THAN RM450000
// LOTNO TYPE NEW PRICE
// . .
-
What is your specific question? If you don't ask and give the details, no one will be able to give an answer.
Similar Threads
-
how to add Arraylist filter for a jsp page showing results from a servlet-Arraylist
By alok_sharma in forum Java ServletReplies: 7Last Post: 11-22-2010, 01:26 PM -
How can I implement an ArrayList in an enum?
By jamesmorlock in forum New To JavaReplies: 2Last Post: 10-29-2010, 10:54 PM -
Problems with a loop calling data from an ArrayList.
By moriarty in forum New To JavaReplies: 30Last Post: 03-28-2010, 02:00 AM -
ArrayList problems
By komo225 in forum New To JavaReplies: 4Last Post: 02-12-2009, 04:14 AM -
[Problems] ArrayList
By Zuela in forum New To JavaReplies: 1Last Post: 06-16-2008, 11:51 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks