Guest User

Untitled

a guest
May 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. From test class -
  2.  
  3. // set the 3 bids
  4. Bid[]newBid;
  5. newBid = new Bid[5];
  6. BidHelper helper1 = new BidHelper();
  7. for (int x = 0; x < 4; ++x) {
  8. newBid[x] = new Bid();
  9. //additional validation needed in the next release
  10. String newbiduser = helper1.getUserInput("Enter Bidder Number 1-3 " );
  11. int u = Integer.parseInt(newbiduser);
  12. //check value statement
  13. //System.out.println(biuser(u));
  14. String newbidinput = helper1.getUserInput("Enter Bid ");
  15. int newbid = Integer.parseInt(newbidinput);
  16. System.out.println(newbid);
  17.  
  18.  
  19. //major changes
  20.  
  21. newBid[x].setBidder(buser[u]);
  22.  
  23. // check value statement
  24. System.out.println(newBid[x].getBidder());
  25.  
  26.  
  27. public class User {
  28. //private String bidrate;
  29. // Class User. A user has an identifier, a rating, and an array of
  30. //items purchased in auctions.
  31. private String biduser;
  32. //private int bidrating;
  33. private int totalrating;
  34. public String getUserid()
  35. { return getBiduser();
  36. }
  37. public void setUserid(String id)
  38. { setBiduser(id);
  39. }
  40. public void addRating(int rating)
  41. { totalrating = rating + totalrating;
  42. }
  43. public int getRating()
  44. { return totalrating;
  45. }
  46. public void setBiduser(String biduser) {
  47. this.biduser = biduser;
  48. }
  49. public String getBiduser() {
  50. return biduser;
  51. }
  52. }
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. public class Bid {
  67. //private String bidder;
  68. private int bidAmount;
  69. private int Bidid;
  70. private int totalbidamount;
  71. private String totalbidder;
  72. private User bidder = new User();
  73.  
  74. //return the value
  75. public User getBidder()
  76. { return bidder;
  77. }
  78. public void setBidder(User u)
  79. { bidder.setUserid(u);
  80. }
  81.  
  82.  
  83.  
  84. // returns the value
  85. public int getBidId() {
  86. return Bidid; }
  87. // sets the value
  88. public void setBidId(int id) {
  89. Bidid = id;
  90. }
  91.  
  92. public int getBidAmount()
  93. { return bidAmount ;
  94. }
  95. public void setBidAmount(int amount)
  96. { bidAmount = amount;
  97. }
Add Comment
Please, Sign In to add comment