Please write a java code using the JOptionPane class for input/output.  Function read list_of_bids Pass In: nothing Initialise count = 0,bid_amount=0   Initialise two dimensional array list_of_bids[number of bids][2] while (count < 10)    Read budget_amount from the user    if budget_amount is not a number then        Print error message "Invalid Input"        continue    Add bid and rating to list_of_bids    Increment the value of count by 1

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 

Please write a java code using the JOptionPane class for input/output. 

Function read list_of_bids
Pass In: nothing
Initialise count = 0,bid_amount=0  
Initialise two dimensional array list_of_bids[number of bids][2]
while (count < 10)
   Read budget_amount from the user
   if budget_amount is not a number then
       Print error message "Invalid Input"
       continue
   Add bid and rating to list_of_bids
   Increment the value of count by 1
end while
Pass Out: 2d array list_of_bids[number of bids][2]
Endfunction


Function calculating average
Pass In: 2d array list_of_bids[number of bids][2]
Initialise bids_array by extracting bids from the 2d array
Initalise average = 0,sum=0,count_of_bids=length of bids array
while bid in bids_array
   sum=sum+bids
average=sum/count_of_bids
Pass Out : average
Endfunction


Function determine winning bid
Pass In: 2d array list_of_bids[number of bids][2], budget
Initialise bids_array by extracting bids from the 2d array passed,2d_budget_array to empty, rating to 5
  Initalise array of winningbid
Initialise budget_bids_array to zero
while elements in bids_array
   if element< budget
   add element to budget_bids_array
sort the budget_bids_array
while element in    budget_bids_array
   find the corresponding rating
   add the element and rating to 2d_budget_array
FOR element in 2d_budget_array
   if elemnts rating==5
       add to winningbid array
Pass Out : winningbid array
Endfunction


Function main
Pass In: Nothing
Print "Enter the budget"
Read budget from the user
  
Call: read list_of_bids
  
Call: calculating average
//may do the printing here or may call a method to print like above
  
Call: determine winning bid
print winning bid
Pass Out: value zero to the operating system
Endfunction

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education