Write a C++ program You will write a program to keep up with bids at an auction. You will have a class “Node” to store the bid amount. You will have a class “LinkedStack” to implement the stack as a linked list. Put your class definition in a header file and the implementation of the methods in a .cpp file. Your program will ask the user for a file name, open a file containing a string (the item being auctioned) followed by a series of integer bid amounts. You do not know how many bids there are so you must read until you reach the end of the file. Make sure you check to see if the file opened properly before you try to process it.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a C++ program
You will write a program to keep up with bids at an auction.
You will have a class “Node” to store the bid amount.
You will have a class “LinkedStack” to implement the stack as a linked list. Put your class definition in a header file and the implementation of the methods in a .cpp file.
Your program will ask the user for a file name, open a file containing a string (the item being auctioned) followed by a series of integer bid amounts. You do not know how many bids there are so you must read until you reach the end of the file. Make sure you check to see if the file opened properly before you try to process it.
Read each bid from the file. If a bid is larger than the last one, you will put it on the stack. Once all bids have been processed your program will display the item and the winning bid. There is no need for a user interface that does more than ask for the file name, display an appropriate message if the file does not exist, and display the item with the winning bid. Also, make sure to define the references.
 
  • You will NEVER use a break, exit, return, pass, continue, or anything to leave a loop (or iteration), function, or other constructs prematurely unless it is part of the structure as in a case statement.
  • You will NEVER have a function call itself unless it is intentional recursion.
  • You will NEVER use global variables.  However, you may use global constants if it is appropriate and they are used properly.
  • You will have only one return statement in a function. (Exception – Multiple return statements may be necessary for a recursive function.)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY