Question 1:
Write a Java program that accepts an integer 'n' from the user and creates 'n' threads. Each thread
should print its thread ID to the console.
Input format:
Enter the number of threads (n): [user enters the value of 'n']
Output format:
Thread [i] is running. Thread ID: [Thread ID]
Thread [i+1] is running. Thread ID: [Thread ID]
...
Thread [n] is running. Thread ID: [Thread ID]
Title for Question 1: Create n threads
Solution:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//System.out.print("Enter the number of threads (n): ");
int n = scanner.nextInt();
for (int i = 1; i<= n; i++) {
Thread thread = new Thread(new MyRunnable(i));
thread.start();
}
// Close the scanner
scanner.close();
}
static class MyRunnable implements Runnable {
private int threadId;
public MyRunnable(int threadId) {
this.threadId = threadId;
}
@Override
public void run() {
System.out.println("Thread " + threadId + " is running. Thread ID: " + Threa
}
}
}
TestCases:
S.No Inputs Outputs
1 2 Thread 2 is running. Thread ID: 12 Thread 1 is running. Thread ID: 11
2 -10
Thread 3 is running. Thread ID: 13 Thread 2 is running. Thread ID: 12
3 3
Thread 1 is running. Thread ID: 11
Thread 2 is running. Thread ID: 12 Thread 5 is running. Thread ID: 15
4 5 Thread 4 is running. Thread ID: 14 Thread 3 is running. Thread ID: 13
Thread 1 is running. Thread ID: 11
Thread 5 is running. Thread ID: 15 Thread 2 is running. Thread ID: 12
5 6 Thread 4 is running. Thread ID: 14 Thread 1 is running. Thread ID: 11
Thread 6 is running. Thread ID: 16 Thread 3 is running. Thread ID: 13
Thread 7 is running. Thread ID: 17 Thread 3 is running. Thread ID: 13
Thread 2 is running. Thread ID: 12 Thread 6 is running. Thread ID: 16
6 8
Thread 8 is running. Thread ID: 18 Thread 5 is running. Thread ID: 15
Thread 4 is running. Thread ID: 14 Thread 1 is running. Thread ID: 11
Question 2:
Create a multi-threaded Java program that prompts the user to enter two integers 'a' and 'b'.
Implement separate threads to perform addition, subtraction, multiplication, and division operations
on these two numbers and display the results?
Input format:
Enter two integers (a and b): [user enters the value of 'a' and 'b' separated by a space]
Output format:
Addition: a + b = result
Subtraction: a - b = result
Multiplication: a * b = result
Division: a / b = result
Title for Question 2: Arithmetic operations using thread
Solution:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//System.out.print("Enter the first integer 'a': ");
int a = scanner.nextInt();
//System.out.print("Enter the second integer 'b': ");
int b = scanner.nextInt();
scanner.close();
// Create threads for each operation
Thread additionThread = new Thread(() -> {
int result = a + b;
System.out.println("Addition result: " + result);
});
Thread subtractionThread = new Thread(() -> {
int result = a - b;
System.out.println("Subtraction result: " + result);
});
Thread multiplicationThread = new Thread(() -> {
int result = a * b;
System.out.println("Multiplication result: " + result);
});
Thread divisionThread = new Thread(() -> {
if (b != 0) {
double result = (double) a / b;
System.out.println("Division result: " + result);
} else {
System.out.println("Division by zero is not allowed.");
}
});
// Start all threads
additionThread.start();
subtractionThread.start();
multiplicationThread.start();
divisionThread.start();
// Wait for all threads to finish
try {
additionThread.join();
subtractionThread.join();
multiplicationThread.join();
divisionThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
TestCases:
S.No Inputs Outputs
Addition result: 8 Multiplication result: 15 Subtraction result: 2 Division result:
1 53
1.6666666666666667
Subtraction result: -2 Multiplication result: 48 Addition result: 14 Division
2 68
result: 0.75
Multiplication result: 16 Subtraction result: -6 Addition result: 10 Division
3 28
result: 0.25
Subtraction result: 3 Multiplication result: 18 Addition result: 9 Division result:
4 63
2.0
Subtraction result: 4 Multiplication result: 21 Addition result: 10 Division
5 73
result: 2.3333333333333335
Addition result: 9 Multiplication result: 8 Subtraction result: 7 Division result:
6 81
8.0
Question 3:
Write a Java program that calculates the factorial of a given number 'n'. Prompt the user to enter
'n', and then create multiple threads to calculate the factorial in parallel with dynamic input from the
user.
Input format:
The program prompts the user to enter an integer 'n', which represents the number for which the
factorial needs to be calculated.
Output Format:
For each number from 1 to 'n', the program prints the calculated factorial value. The output format
is as follows:
Enter the number to calculate factorial: [user_input_n]
Factorial of 1 = [factorial_of_1]
Factorial of 2 = [factorial_of_2]
Factorial of 3 = [factorial_of_3]
Factorial of [user_input_n] = [factorial_of_n]
Title for Question 3: Factorial
Solution:
import java.math.BigInteger;
import java.util.Scanner;
import java.util.concurrent.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//System.out.print("Enter the number to calculate factorial: ");
int n = scanner.nextInt();
// Create a thread pool with a fixed number of threads
int numThreads = Math.min(n, 5); // Limiting the number of threads to avoid
ExecutorService executor = Executors.newFixedThreadPool(numThreads);
List<Future<BigInteger>> futures = new ArrayList<>();
for (int i = 1; i<= n; i++) {
Callable<BigInteger> task = new FactorialTask(i);
Future<BigInteger> future = executor.submit(task);
futures.add(future);
}
// Shutdown the thread pool after all tasks are completed
executor.shutdown();
// Wait for all tasks to complete and print the results
for (int i = 1; i<= n; i++) {
try {
BigInteger result = futures.get(i - 1).get();
System.out.println("Factorial of " + i + " = " + result);
} catch (InterruptedException | ExecutionException e) {
System.out.println("Error calculating factorial of " + i + ": " + e.getMessa
}
}
scanner.close();
}
static class FactorialTask implements Callable<BigInteger> {
private int number;
public FactorialTask(int number) {
this.number = number;
}
@Override
public BigInteger call() throws Exception {
return factorial(number);
}
private BigInteger factorial(int n) {
BigInteger result = BigInteger.ONE;
for (int i = 1; i<= n; i++) {
result = result.multiply(BigInteger.valueOf(i));
}
return result;
}
}
}
TestCases:
S.No Inputs Outputs
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
1 5
Factorial of 5 = 120
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
2 8 Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 7 = 5040 Factorial of 8 =
40320
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
3 10 Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 7 = 5040 Factorial of 8 =
40320 Factorial of 9 = 362880 Factorial of 10 = 3628800
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 7 = 5040 Factorial of 8 =
4 14 40320 Factorial of 9 = 362880 Factorial of 10 = 3628800 Factorial of 11 =
39916800 Factorial of 12 = 479001600 Factorial of 13 = 6227020800
Factorial of 14 = 87178291200
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
5 9 Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 7 = 5040 Factorial of 8 =
40320 Factorial of 9 = 362880
Factorial of 1 = 1 Factorial of 2 = 2 Factorial of 3 = 6 Factorial of 4 = 24
Factorial of 5 = 120 Factorial of 6 = 720 Factorial of 7 = 5040 Factorial of 8 =
40320 Factorial of 9 = 362880 Factorial of 10 = 3628800 Factorial of 11 =
39916800 Factorial of 12 = 479001600 Factorial of 13 = 6227020800
6 20
Factorial of 14 = 87178291200 Factorial of 15 = 1307674368000 Factorial of
16 = 20922789888000 Factorial of 17 = 355687428096000 Factorial of 18 =
6402373705728000 Factorial of 19 = 121645100408832000 Factorial of 20
= 2432902008176640000
Question 4:
Create a Java program that simulates a basic bank account system. Prompt the user to enter an
initial balance and perform multiple deposit and withdrawal operations using separate threads.
Ensure that the account balance remains consistent throughout the transactions with dynamic input
from the user.
Input Format:
The user is prompted to enter the initial balance of the bank account.
The user can then perform multiple deposit and withdrawal operations by entering amounts
interactively. For each deposit and withdrawal, the user should enter a valid amount (a positive
value for deposit, and a non-negative value for withdrawal) or enter 0 to stop depositing or
withdrawing.
Output Format:
After each deposit operation, the program will display the deposit amount and the new account
balance.
After each withdrawal operation, the program will display the withdrawal amount and the new
account balance if the withdrawal is successful. If the withdrawal is not allowed due to insufficient
balance, the program will display a message indicating so.
The final account balance will be displayed after both the deposit and withdrawal threads complete.
Title for Question 4: Basic bank account system
Solution:
import java.util.Scanner;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
//System.out.print("Enter initial balance: ");
double initialBalance = scanner.nextDouble();
BankAccount account = new BankAccount(initialBalance);
// Create and start deposit thread
Thread depositThread = new Thread(() -> {
while (true) {
//System.out.print("Enter deposit amount (or 0 to stop depos
double amount = scanner.nextDouble();
if (amount == 0) {
break;
}
account.deposit(amount);
}
});
depositThread.start();
// Create and start withdrawal thread
Thread withdrawalThread = new Thread(() -> {
while (true) {
//System.out.print("Enter withdrawal amount (or 0 to stop wi
double amount = scanner.nextDouble();
if (amount == 0) {
break;
}
account.withdraw(amount);
}
});
withdrawalThread.start();
// Wait for both threads to complete
try {
depositThread.join();
withdrawalThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Final account balance: " + account.getBalance());
scanner.close();
}
static class BankAccount {
private double balance;
private Lock lock;
public BankAccount(double initialBalance) {
this.balance = initialBalance;
this.lock = new ReentrantLock();
}
public void deposit(double amount) {
lock.lock();
try {
balance += amount;
System.out.println("Deposited: " + amount + ", New balance: " + balance);
} finally {
lock.unlock();
}
}
public void withdraw(double amount) {
lock.lock();
try {
if (balance >= amount) {
balance -= amount;
System.out.println("Withdrawn: " + amount + ", New balance: " + balance);
} else {
System.out.println("Insufficient balance. Withdrawal not allowed.");
}
} finally {
lock.unlock();
}
}
public double getBalance() {
return balance;
}
}
}
TestCases:
S.No Inputs Outputs
Deposited: 3000.0, New balance: 11000.0 Withdrawn: 100.0, New
8000 100
balance: 10900.0 Withdrawn: 700.0, New balance: 10200.0
1 3000 0 700
Withdrawn: 1000.0, New balance: 9200.0 Withdrawn: 400.0, New
1000 400 0
balance: 8800.0 Final account balance: 8800.0
Deposited: 200.0, New balance: 1200.0 Withdrawn: 300.0, New
1000 200
balance: 900.0 Withdrawn: 800.0, New balance: 100.0 Insufficient
2 300 0 800
balance. Withdrawal not allowed. Insufficient balance. Withdrawal not
1000 200 0
allowed. Final account balance: 100.0
Deposited: 100.0, New balance: 600.0 Withdrawn: 150.0, New
500 100 150
balance: 450.0 Deposited: 50.0, New balance: 500.0 Deposited:
3 50 0 200 400
200.0, New balance: 700.0 Deposited: 400.0, New balance: 1100.0
0
Final account balance: 1100.0
2000 400 Deposited: 400.0, New balance: 2400.0 Withdrawn: 100.0, New
4 100 0 500 balance: 2300.0 Withdrawn: 500.0, New balance: 1800.0 Withdrawn:
800 0 800.0, New balance: 1000.0 Final account balance: 1000.0
1500 300 Deposited: 300.0, New balance: 1800.0 Withdrawn: 200.0, New
5 200 0 250 balance: 1600.0 Withdrawn: 250.0, New balance: 1350.0 Withdrawn:
800 0 800.0, New balance: 550.0 Final account balance: 550.0
10000 1500 Deposited: 1500.0, New balance: 11500.0 Deposited: 8000.0, New
6 0 8000 5000 balance: 19500.0 Deposited: 5000.0, New balance: 24500.0 Final
0 account balance: 24500.0
Question 5:
Discuss a real-time scenario in an online auction platform where multithreading is essential. Create
a Java program that uses threads to simulate bid updates and time tracking for multiple ongoing
auctions, highlighting synchronization mechanisms that maintain fair and consistent bidding
processes.
Input Format:
Enter the number of auctions:[User Input: Number of Auctions]
Output Format:
Display auction creation status for each auction:
Auction [Auction ID] created.
Display bid updates for each auction:
Auction [Auction ID]: New highest bid - $[Highest Bid] Auction [Auction ID]: Bid rejected - $[Bid
Amount]
Display auction closure status:
Auction [Auction ID] closed.
Display auction results:
Auction Results: Auction [Auction ID]: Highest Bid - $[Highest Bid]
Replace [User Input: Number of Auctions], [Auction ID], [Highest Bid], and [Bid Amount] with the
actual values provided by the user and the program's output.
Title for Question 5: Auction
Solution:
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;
class AuctionPlatform {
private List<Auction> auctions;
public AuctionPlatform() {
auctions = new ArrayList<>();
}
public synchronized void createAuction(Auction auction) {
auctions.add(auction);
System.out.println("Auction " + auction.getAuctionId() + " created."
}
public synchronized void startAuctions() {
for (Auction auction : auctions) {
Thread thread = new Thread(auction);
thread.start();
}
}
public synchronized void showResults() {
System.out.println("\nAuction Results:");
for (Auction auction : auctions) {
System.out.println("Auction " + auction.getAuctionId() + ": High
}
}
}
class Auction implements Runnable {
private static int auctionCounter = 1;
private int auctionId;
private int highestBid = 0;
private boolean isOpen = true;
public Auction() {
auctionId = auctionCounter++;
}
public int getAuctionId() {
return auctionId;
}
public synchronized void placeBid(int bidAmount) {
if (bidAmount > highestBid) {
highestBid = bidAmount;
System.out.println("Auction " + auctionId + ": New highest bid -
} else {
System.out.println("Auction " + auctionId + ": Bid rejected - $"
}
}
public synchronized int getHighestBid() {
return highestBid;
}
public synchronized void closeAuction() {
isOpen = false;
}
public synchronized boolean isOpen() {
return isOpen;
}
@Override
public void run() {
Random random = new Random();
while (isOpen) {
int bidAmount = random.nextInt(100) + 1; // Generate a random bi
placeBid(bidAmount);
try {
Thread.sleep(1000); // Simulate time passing between bids
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Auction " + auctionId + " closed.");
}
}
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// System.out.print("Enter the number of auctions: ");
int numAuctions = scanner.nextInt();
AuctionPlatform auctionPlatform = new AuctionPlatform();
for (int i = 0; i < numAuctions; i++) {
Auction auction = new Auction();
auctionPlatform.createAuction(auction);
}
auctionPlatform.startAuctions();
try {
Thread.sleep(10000); // Simulate auctions running for 10 seconds
} catch (InterruptedException e) {
e.printStackTrace();
}
auctionPlatform.showResults();
scanner.close();
}
}
TestCases:
S.No Inputs Outputs
Auction 1 created. Auction 2 created. Auction 2: New highest bid - $32
Auction 1: New highest bid - $57 Auction 2: New highest bid - $42 Auction 1:
Bid rejected - $16 Auction 2: Bid rejected - $5 Auction 1: Bid rejected - $40
Auction 2: Bid rejected - $12 Auction 1: New highest bid - $70 Auction 2:
New highest bid - $83 Auction 1: Bid rejected - $52 Auction 2: Bid rejected -
1 2
$4 Auction 1: Bid rejected - $8 Auction 2: Bid rejected - $21 Auction 1: New
highest bid - $95 Auction 2: Bid rejected - $56 Auction 1: Bid rejected - $37
Auction 2: Bid rejected - $53 Auction 1: Bid rejected - $31 Auction 2: Bid
rejected - $9 Auction 1: Bid rejected - $68 Auction Results: Auction 1:
Highest Bid - $95 Auction 2: Highest Bid - $83
Auction 1 created. Auction 2 created. Auction 3 created. Auction 4 created.
Auction 2: New highest bid - $31 Auction 1: New highest bid - $88 Auction 3:
New highest bid - $82 Auction 4: New highest bid - $35 Auction 2: New
highest bid - $77 Auction 1: Bid rejected - $27 Auction 4: New highest bid -
$36 Auction 3: Bid rejected - $34 Auction 1: Bid rejected - $81 Auction 3:
New highest bid - $92 Auction 2: Bid rejected - $72 Auction 4: New highest
bid - $59 Auction 1: Bid rejected - $58 Auction 3: Bid rejected - $43 Auction
2: Bid rejected - $45 Auction 4: Bid rejected - $14 Auction 1: Bid rejected -
$22 Auction 3: Bid rejected - $14 Auction 2: Bid rejected - $30 Auction 4: Bid
2 4 rejected - $41 Auction 1: Bid rejected - $39 Auction 3: Bid rejected - $86
Auction 2: Bid rejected - $52 Auction 4: Bid rejected - $21 Auction 1: Bid
rejected - $14 Auction 3: Bid rejected - $38 Auction 2: New highest bid - $98
Auction 4: Bid rejected - $59 Auction 1: Bid rejected - $8 Auction 3: Bid
rejected - $72 Auction 2: Bid rejected - $86 Auction 4: Bid rejected - $53
Auction 1: Bid rejected - $1 Auction 3: Bid rejected - $75 Auction 2: Bid
rejected - $31 Auction 4: Bid rejected - $26 Auction 1: Bid rejected - $11
Auction 3: Bid rejected - $83 Auction 2: Bid rejected - $53 Auction 4: New
highest bid - $66 Auction Results: Auction 1: Highest Bid - $88 Auction 2:
Highest Bid - $98 Auction 3: Highest Bid - $92 Auction 4: Highest Bid - $66
S.No Inputs Outputs
Auction 1 created. Auction 2 created. Auction 3 created. Auction 4 created.
Auction 5 created. Auction 6 created. Auction 3: New highest bid - $9
Auction 6: New highest bid - $73 Auction 1: New highest bid - $6 Auction 5:
New highest bid - $14 Auction 4: New highest bid - $45 Auction 2: New
highest bid - $45 Auction 3: New highest bid - $59 Auction 1: New highest
bid - $100 Auction 5: New highest bid - $84 Auction 4: New highest bid - $56
Auction 6: Bid rejected - $53 Auction 2: New highest bid - $56 Auction 3: Bid
rejected - $3 Auction 1: Bid rejected - $91 Auction 5: Bid rejected - $20
Auction 4: Bid rejected - $40 Auction 6: Bid rejected - $35 Auction 2: Bid
rejected - $20 Auction 3: New highest bid - $61 Auction 1: Bid rejected - $74
Auction 5: Bid rejected - $39 Auction 4: Bid rejected - $54 Auction 6: Bid
rejected - $14 Auction 2: New highest bid - $60 Auction 3: New highest bid -
$84 Auction 1: Bid rejected - $82 Auction 5: Bid rejected - $13 Auction 4: Bid
3 6
rejected - $52 Auction 6: Bid rejected - $28 Auction 2: New highest bid - $79
Auction 3: Bid rejected - $62 Auction 1: Bid rejected - $88 Auction 5: New
highest bid - $88 Auction 4: Bid rejected - $24 Auction 6: New highest bid -
$83 Auction 2: Bid rejected - $76 Auction 3: Bid rejected - $4 Auction 1: Bid
rejected - $2 Auction 5: New highest bid - $93 Auction 6: New highest bid -
$93 Auction 4: New highest bid - $72 Auction 2: Bid rejected - $16 Auction 3:
Bid rejected - $78 Auction 1: Bid rejected - $9 Auction 5: New highest bid -
$98 Auction 4: Bid rejected - $19 Auction 6: Bid rejected - $52 Auction 2: Bid
rejected - $49 Auction 3: New highest bid - $88 Auction 1: Bid rejected - $36
Auction 6: Bid rejected - $60 Auction 4: New highest bid - $90 Auction 5: Bid
rejected - $92 Auction 2: Bid rejected - $65 Auction 3: Bid rejected - $14
Auction 1: Bid rejected - $23 Auction 5: Bid rejected - $27 Auction 6: Bid
rejected - $39 Auction 4: Bid rejected - $8 Auction 2: Bid rejected - $79
S.No Inputs Outputs
Auction 1 created. Auction 2 created. Auction 3 created. Auction 4 created.
Auction 5 created. Auction 6 created. Auction 7 created. Auction 8 created.
Auction 1: New highest bid - $53 Auction 5: New highest bid - $15 Auction 4:
New highest bid - $31 Auction 7: New highest bid - $68 Auction 6: New
highest bid - $2 Auction 3: New highest bid - $97 Auction 8: New highest bid
- $66 Auction 2: New highest bid - $53 Auction 5: New highest bid - $65
Auction 4: New highest bid - $37 Auction 6: New highest bid - $65 Auction 1:
Bid rejected - $13 Auction 8: New highest bid - $77 Auction 7: Bid rejected -
$47 Auction 3: Bid rejected - $14 Auction 2: Bid rejected - $49 Auction 5: Bid
rejected - $59 Auction 4: Bid rejected - $26 Auction 6: Bid rejected - $12
Auction 8: Bid rejected - $58 Auction 1: New highest bid - $86 Auction 7: Bid
rejected - $55 Auction 3: Bid rejected - $20 Auction 2: Bid rejected - $36
Auction 5: New highest bid - $99 Auction 4: New highest bid - $59 Auction 6:
New highest bid - $72 Auction 8: Bid rejected - $29 Auction 1: Bid rejected -
$32 Auction 7: New highest bid - $81 Auction 3: Bid rejected - $66 Auction 2:
New highest bid - $91 Auction 5: Bid rejected - $29 Auction 4: New highest
bid - $66 Auction 7: Bid rejected - $52 Auction 8: Bid rejected - $37 Auction
1: Bid rejected - $62 Auction 3: Bid rejected - $32 Auction 6: New highest bid
- $76 Auction 2: Bid rejected - $58 Auction 5: Bid rejected - $79 Auction 4:
4 8
New highest bid - $71 Auction 7: Bid rejected - $68 Auction 8: Bid rejected -
$31 Auction 1: Bid rejected - $79 Auction 6: Bid rejected - $24 Auction 3: Bid
rejected - $92 Auction 2: Bid rejected - $90 Auction 5: Bid rejected - $99
Auction 4: Bid rejected - $33 Auction 7: New highest bid - $90 Auction 8: Bid
rejected - $2 Auction 1: Bid rejected - $76 Auction 6: Bid rejected - $41
Auction 3: Bid rejected - $88 Auction 2: Bid rejected - $56 Auction 5: Bid
rejected - $99 Auction 4: Bid rejected - $28 Auction 7: Bid rejected - $27
Auction 8: Bid rejected - $48 Auction 1: Bid rejected - $57 Auction 6: Bid
rejected - $29 Auction 3: Bid rejected - $8 Auction 2: Bid rejected - $82
Auction 5: Bid rejected - $51 Auction 4: Bid rejected - $48 Auction 7: Bid
rejected - $62 Auction 8: Bid rejected - $61 Auction 1: New highest bid - $88
Auction 6: Bid rejected - $11 Auction 3: Bid rejected - $93 Auction 2: Bid
rejected - $35 Auction 5: Bid rejected - $29 Auction 4: New highest bid - $85
Auction 7: Bid rejected - $62 Auction 8: Bid rejected - $51 Auction 1: Bid
rejected - $75 Auction 6: Bid rejected - $36 Auction 3: Bid rejected - $16
Auction 2: Bid rejected - $86 Auction Results: Auction 1: Highest Bid - $88
Auction 2: Highest Bid - $91 Auction 3: Highest Bid - $97 Auction 4: Highest
Bid - $85 Auction 5: Highest Bid - $99 Auction 6: Highest Bid - $76 Auction
7: Highest Bid - $90 Auction 8: Highest Bid - $77
S.No Inputs Outputs
Auction 1 created. Auction 2 created. Auction 3 created. Auction 4 created.
Auction 5 created. Auction 3: New highest bid - $95 Auction 5: New highest
bid - $25 Auction 1: New highest bid - $7 Auction 2: New highest bid - $11
Auction 4: New highest bid - $18 Auction 5: New highest bid - $100 Auction
3: Bid rejected - $61 Auction 4: Bid rejected - $8 Auction 2: New highest bid
- $54 Auction 1: New highest bid - $24 Auction 5: Bid rejected - $100
Auction 3: Bid rejected - $20 Auction 2: New highest bid - $61 Auction 1:
New highest bid - $54 Auction 4: New highest bid - $86 Auction 5: Bid
rejected - $4 Auction 3: New highest bid - $100 Auction 1: Bid rejected - $35
Auction 4: Bid rejected - $84 Auction 2: Bid rejected - $44 Auction 5: Bid
rejected - $50 Auction 3: Bid rejected - $21 Auction 1: New highest bid - $71
Auction 4: New highest bid - $97 Auction 2: Bid rejected - $49 Auction 5: Bid
5 5
rejected - $76 Auction 3: Bid rejected - $59 Auction 1: New highest bid - $98
Auction 4: Bid rejected - $19 Auction 2: New highest bid - $94 Auction 5: Bid
rejected - $88 Auction 3: Bid rejected - $78 Auction 1: Bid rejected - $16
Auction 4: Bid rejected - $24 Auction 2: Bid rejected - $27 Auction 5: Bid
rejected - $6 Auction 3: Bid rejected - $86 Auction 1: Bid rejected - $47
Auction 4: Bid rejected - $7 Auction 2: Bid rejected - $79 Auction 5: Bid
rejected - $33 Auction 1: Bid rejected - $5 Auction 3: Bid rejected - $5
Auction 4: Bid rejected - $52 Auction 2: Bid rejected - $64 Auction 5: Bid
rejected - $98 Auction 1: Bid rejected - $25 Auction 3: Bid rejected - $3
Auction 2: Bid rejected - $2 Auction 4: Bid rejected - $15 Auction Results:
Auction 1: Highest Bid - $98 Auction 2: Highest Bid - $94 Auction 3: Highest
Bid - $100 Auction 4: Highest Bid - $97 Auction 5: Highest Bid - $100
S.No Inputs Outputs
Auction 1 created. Auction 2 created. Auction 3 created. Auction 4 created.
Auction 5 created. Auction 6 created. Auction 7 created. Auction 3: New
highest bid - $86 Auction 7: New highest bid - $83 Auction 6: New highest
bid - $69 Auction 1: New highest bid - $7 Auction 2: New highest bid - $35
Auction 4: New highest bid - $38 Auction 5: New highest bid - $6 Auction 7:
New highest bid - $97 Auction 3: Bid rejected - $10 Auction 6: New highest
bid - $81 Auction 1: New highest bid - $99 Auction 2: Bid rejected - $26
Auction 4: New highest bid - $44 Auction 5: New highest bid - $87 Auction 7:
Bid rejected - $51 Auction 3: Bid rejected - $23 Auction 6: Bid rejected - $30
Auction 1: Bid rejected - $72 Auction 2: New highest bid - $44 Auction 4:
New highest bid - $65 Auction 5: Bid rejected - $19 Auction 7: Bid rejected -
$79 Auction 3: Bid rejected - $43 Auction 6: Bid rejected - $16 Auction 1: Bid
rejected - $78 Auction 4: Bid rejected - $37 Auction 2: Bid rejected - $7
Auction 5: Bid rejected - $84 Auction 7: Bid rejected - $43 Auction 3: Bid
rejected - $27 Auction 6: Bid rejected - $13 Auction 1: Bid rejected - $76
Auction 4: New highest bid - $97 Auction 2: New highest bid - $72 Auction 5:
Bid rejected - $4 Auction 7: Bid rejected - $52 Auction 3: Bid rejected - $27
6 10
Auction 6: Bid rejected - $49 Auction 1: Bid rejected - $37 Auction 4: Bid
rejected - $21 Auction 2: Bid rejected - $26 Auction 5: Bid rejected - $54
Auction 7: Bid rejected - $43 Auction 3: Bid rejected - $7 Auction 6: Bid
rejected - $63 Auction 1: Bid rejected - $38 Auction 4: Bid rejected - $87
Auction 2: New highest bid - $96 Auction 5: Bid rejected - $73 Auction 7: Bid
rejected - $78 Auction 3: Bid rejected - $76 Auction 6: Bid rejected - $11
Auction 1: Bid rejected - $60 Auction 4: Bid rejected - $7 Auction 2: Bid
rejected - $44 Auction 5: Bid rejected - $38 Auction 7: Bid rejected - $58
Auction 3: Bid rejected - $85 Auction 6: Bid rejected - $5 Auction 4: Bid
rejected - $47 Auction 5: New highest bid - $97 Auction 1: Bid rejected - $23
Auction 2: Bid rejected - $94 Auction 7: Bid rejected - $9 Auction 3: Bid
rejected - $78 Auction 6: Bid rejected - $62 Auction 5: Bid rejected - $74
Auction 4: Bid rejected - $91 Auction 1: Bid rejected - $42 Auction 2: Bid
rejected - $72 Auction Results: Auction 1: Highest Bid - $99 Auction 2:
Highest Bid - $96 Auction 3: Highest Bid - $86 Auction 4: Highest Bid - $97
Auction 5: Highest Bid - $97 Auction 6: Highest Bid - $81 Auction 7: Highest
Bid - $97