making a auction system (need help how do i make this | Sololearn: Learn to code for FREE!
0

making a auction system (need help how do i make this

import java.util.Scanner; import javax.swing.JOptionPane; public class cc11pt { Scanner scan = new Scanner(System.in); String[] bidItem = {"Random Car"}; int startingBid = 1500000; int bidderamount; String role; String auctioneer; String auctionItem; int auctioneeramount; String bidder; role = JOptionPane.showInputDialog("Please choose your role: Auctioneer / Bidder"); switch(role) public cc11pt(String bidder) { this.bidder = bidder; } public String getBidder() { return bidder; } public void setBidder(String bidder) { this.bidder = bidder; } { System.out.println("Please fill in the following information:"); System.out.println("Name/Company:"); auctioneer = scan.next(); System.out.println("Auction Item:"); auctionItem = scan.next(); System.out.println("Starting Bid Amount:"); auctioneeramount = scan.nextInt(); String auctioneerBid = Integer.toString(auctioneeramount); JOptionPane.showMessageDialog(null, "Name/Company: " + auctioneer + " Auction Item: " + auctionItem + " Starting Bid Amount: " + auctioneerBid); //joption msg dialog for "your auction item is being posted. we will notify you if there are bidders" break; System.out.println("The item up for auction is: " + bidItem[0] + " with a starting bid of " + startingBid + "."); // add joption for would you like to proceed: yes or no" System.out.println("Please fill in the following information:"); System.out.println("Name:"); bidder = scan.next(); System.out.println("Bidding Amount:"); bidderamount = scan.nextInt(); if (startingBid >= bidderamount) { System.out.println("You must bid an amount higher than the starting price."); } else { String bidderBid = Integer.toString(bidderamount); JOptionPane.showMessageDialog(null, "Name: " + bid

9th Dec 2022, 12:38 PM
Nile lon
Nile lon - avatar
1 Antwort
+ 2
Your code has been cut off. It's better to copy the code into the code playground and attach it here.
12th Dec 2022, 10:52 AM
Ausgrindtube
Ausgrindtube - avatar