Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From test class -
- // set the 3 bids
- Bid[]newBid;
- newBid = new Bid[5];
- BidHelper helper1 = new BidHelper();
- for (int x = 0; x < 4; ++x) {
- newBid[x] = new Bid();
- //additional validation needed in the next release
- String newbiduser = helper1.getUserInput("Enter Bidder Number 1-3 " );
- int u = Integer.parseInt(newbiduser);
- //check value statement
- //System.out.println(biuser(u));
- String newbidinput = helper1.getUserInput("Enter Bid ");
- int newbid = Integer.parseInt(newbidinput);
- System.out.println(newbid);
- //major changes
- newBid[x].setBidder(buser[u]);
- // check value statement
- System.out.println(newBid[x].getBidder());
- public class User {
- //private String bidrate;
- // Class User. A user has an identifier, a rating, and an array of
- //items purchased in auctions.
- private String biduser;
- //private int bidrating;
- private int totalrating;
- public String getUserid()
- { return getBiduser();
- }
- public void setUserid(String id)
- { setBiduser(id);
- }
- public void addRating(int rating)
- { totalrating = rating + totalrating;
- }
- public int getRating()
- { return totalrating;
- }
- public void setBiduser(String biduser) {
- this.biduser = biduser;
- }
- public String getBiduser() {
- return biduser;
- }
- }
- public class Bid {
- //private String bidder;
- private int bidAmount;
- private int Bidid;
- private int totalbidamount;
- private String totalbidder;
- private User bidder = new User();
- //return the value
- public User getBidder()
- { return bidder;
- }
- public void setBidder(User u)
- { bidder.setUserid(u);
- }
- // returns the value
- public int getBidId() {
- return Bidid; }
- // sets the value
- public void setBidId(int id) {
- Bidid = id;
- }
- public int getBidAmount()
- { return bidAmount ;
- }
- public void setBidAmount(int amount)
- { bidAmount = amount;
- }
Add Comment
Please, Sign In to add comment