Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Must be in C# (NO JAVA)! Will upvote Introduction: In thia weok's abaignment youil write aoftware for an auction company. Your program will allow the
Must be in C# (NO JAVA)! Will upvote
Introduction: In thia weok's abaignment youil write aoftware for an auction company. Your program will allow the auction company to enter 'Lotn' of iloms for sale. A Lof is either one ikm. or a bunch of ltems which are being sold together. Fach item has a starting price, and a bid increment. For example an item may start off as 5100 , with a bid increment of 226. Which means the next lowest amount sonieone can bid is 3126, then 3160 ete. People can of course bid more than the bid increment. An auction can have as many liems as they want, but only one tem will be available to bid at any given time. Tasks: - Degin by creating a class called Lot - It must have private attibutes for lotpumitier (irk), description (string), amenthied (int). bidincrement (int), sold (boolean) - Each lot will be sequertially mumbered starting at 1001 - Write a delault constructor which sets. IotNumber to the next sequential number. le, the frust object of type Lof should have a lotNumber of 1001, the next object should be 1002. Hien 1003 ete. The person cieating the object wil not need to pass this value in. in li be calculated in the class itsetf. Description ahoud be set to "Uniknown Hem' currentfid and bidincrement should bath be set to . sold shouk tie set to false. - Wrile an overioaded consiructor that takes in a description, starting tid and bidincrement. Again, the biNumber should be automaticaly calculated, just the in the defaul constructor The description, curronthid and bidincrement should be set to the paramieters passed in sold should be set to talse - Create a method marksold, which snts Sola to true - Create a getter method for sold, bidincrement and description - Create a setter method tor currenthid - Create a method nextbid which returns the niod possitile lowest bid Thes is the curtentflid - the bilncremient - Create an overinde of tosting ( (lava) of fosting (C=) If the lot is sold (chinck the booleav). motum a strine wa - Lol 1001 Deserotion was sola tor 3500 If the lof is rot seidd teturn a string the - "Lot 1001. Description current bid $100 minimum bid $120" o In both cases Lot 1001 should be the actual lat number, the description should replace the word Description and the current bid/sold amount should be the current bid, and the mhimum bid shosid be the nextlid. Next you'li wite a number of methods in your driver dass: Write a method getNextiot. - This will take in an ArayList (Jara) or List (Ces) of Lots. it should return a Lot If the auction ArrayListlist has items in it, return the first item (from cell 0 ) and remove it from the ArraylistList. Otherwise retum an empty Lot created using the delault constructor. Write a method additiem 0. This will take in an Arraylist ( Java) or List ( CA) of iots it will return void It will prompt the user for a new Desoription, starting bid, and bid increment, then create a lot and add it to the Arraytistlist that was passed in. - Write a methed bid This will take in a Lot Ask the user how much they want to bid, and iel them the minimum bid they must make. Read in the users bid If t's too smal (below the minimum bid) tell them. Otherwise charge the current bid for this Lot item to the amount they bid. Create a method marksoid Q. This wil take in a Lot Mark the lot as sold Print out the current Lot - Create a method martMena This wil take in an ArrayList (dara) or Lest (C) of Lots Define a aurrentiot of type tot and set it to nut. Using a loop youll print out the menu unti the user chooses opton 5 : If you curtenty tave a Lot to bid on, pont Curtent tot Followed by the deecription et the lat If you don? have a lot yet (ourrenti ot is nit or is desengton is Uivencan tiem'1 print "We are not cairterity bidaing? Noxt pant the menu - I. Ada lot tiauction. - 2 Start bidang on next tor - I. Eid on ciment Lot - 4. Mank ourent Lot sola - 5. Qut Read in the users chicist * If the user chooses? 3 use the approcriate method bo acd an iterit to the aucion. - If the user chooses 2, frst cheok that there are Lots in the auction. If there are currenty none print "There is nothing to bid on, add an tem first o If you have a current lot, and ifs not sold print 'You must mark the current lot as sold before bringing up the next Lot 2 0. Otherwise get the next lot and store it in currentLot If the user chooses 3 and the current lot is nul, or the current lot's description is "Unknown liem" or the current lot bs soid print "You must first bring a Lot up for bidding" Othenwise, allow the user to bid If the user chocses 4 and the current lot is nul or the current lo's descriptions is 'Unknown ltem', or the current lot is sold print: 'You must frst bring a Lot up for Bidding" - Othenwise, mark the current lot as sold Your main method should simple create an ArayList (Java) or List (CH) of Lot called auction. Example Runs: [User input in red] We are not currently bidding 1. Add Lot to Auction 2. Start bidding on next Lot 3. Gid on curtent Lot 4. Mark current Lot Sold 5. Exit 1 What is the description of this item 65 Samsung OLED TV What is the starting bid Ue0 What is the bid increment 25 We are not currently bidiaing 1. Add Lot to Auction 2. Start bidding on next Lat 3. Bid on curtent Lot 4. Mark cuirrent tot Soid 5.) Exit What is the desefpton of this tem Desk Lame What is the starting bid What is the bid increment 5. We are not currently bidding 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 1 What is the description of this item Gamer Chair, red with amrests. What is the sitarting bid 100 What is the bid increment 10 We are not currently bidding 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 3 You must first bring a Lot up for bidding We are not currently bidding 1. Add Lot to Auction 2. Start bidding on next Lot 3. Eld on current Lot 4 Mark current Lot Soid 5. Ext 4 You must tirst bring a Lot up for bidaing Wo are not currently bidding 1. Add Lot to Auction 2 Start bidaing on next Lat 3. Bid pocurrent Los 4. Mark current Lotscid 6. Exit 2 Gurrent Lot Lot 1001. 65 Samsung OLED TV current bid: $350 minimum bid: $375 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 3. How much would you like to bid? Minimum bid is 375 375 Current Lot: Lot 1001. 65 Samsung OLED TV current bid: $375 minimum bid: $400 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 3 How much would you like to bid? Minimum bid is 400 500 Current Lot: Lot 1001. 66 ' Samsung OLED TV current bid: $500 mimimum bid: $525 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid an current Lot 4. Mark current Lot Soid 5. Exat 4 Lot 1001.65 Samsung OLED IV was sold for 5400 Current Lot: Lof 1001.65Samsung OLtb IV was seld far 5500 1. Add Lof to Auction 2 Start bidding on next Lol 3. Eid on curnent Lot 4. Mark curtent Lot Sold 5. Exot You muat firs bang a Lot up toc tideting Current Lot tob 1001. 65 . Samicling olep ry was soldtor sgop 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 2 Current Lot: Lot 1002 . Desk Lamp current bid: $6 minimum bid: $10 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 3. How much would you like to bid? Minimum bid is 10 10 Current Lot: Lot 1002 . Desk Lamp current bid: $10 minimum bid: $15 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid an current Lot 4. Mark current Lat Sold 5. Exit 2 You must mark the current Lot as sold before bringing up the nest Lot. Current Lot Lo? 1002 , Desk Lamp current bid 510 minimum bid $15 1. Add tot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lat Sold 5. Exit 4. Lot 1002. Lesk: Lamp was sold for $10 Curtent Lot Lot 1002 Deak Laitp was sold tor 570 1. Add Lot to Auction 2. Stat biading on mext Lot Jele en ciatent tof 4. Mark cument Lot Sold 5. Exit 2 Current Lot Lot 1003. Gamer Chair, red with armrests: cument bid: $100 minimum bid: $110 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 3 How much would you like to bid? Minimum bid is 110 150 Current Lot: Lot 1003. Gamer Chair, red with armrests, current bid: $150 minimum bid: $160 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark cument Lot Sold 6. Exit 3. How much would you like to bid? Minimum bid in 160 200 Current Lot: Lot 1003. Gamer Chaic, red with armrests, current bid: $200 minimum bid: 5210 1. Add Lot to Auction 2. Start bidding on hext Lot 3. Bid on current Lot 4. Mark cument Lot Sold 5. Exat 3 How much would you like to bid? Minimum bid 15210 350 Current Lot: Lot 1003. Gamer Chale, red with amrests current bid: 5350 mnimum bid 5360 1. Add Lor so Auction 2. Start bidding on next Lot 3. Bid of cuirent Lot 4. Mark current Lot Sold 5. Exit 3 How much would you like to bid? Minimum bid is 360 300 You must bid at least 360 Current Lot: Lot 1003. Gamer Chair, red with armrests. current bid: $350 minimum bid: $360 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit 4 Lot 1003. Gamer Chair, red with amrests. was sold for $350 Current Lot: Lot 1003. Gamer Chair, red with armrests was sold for $350 1. Add Lot to Auction 2. Start bidding on next Lot 3. Bid on current Lot 4. Mark current Lot Sold 5. Exit Submitting your answer: You'l submit Lol java or Lot cs as well as your triver dass on gradescopt as assignment 2. Be sute to submit both files as a single yubmission. Please follow the posted submission guidelinew here Ensure you submit before the deadine listed on the lab schedule for CSE 1322L here Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started