Skip to content

assertX/assertX_Maximum-Value-in-a-Bag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

assertX_Maximum-Value-in-a-Bag

In this assignment, you are going to write a generic class, Bag. A Bag is a simple container that can hold items. It is unordered. We cannot sort or order items in a Bag. A Bag is homogenous; that is, it can only hold items of a single type.

The Input File

•The input file is a plain text file (filename: bags.txt).

•In each row of the input file, the first data field is the type of bag, either "integer", "double", or "string". The second data field is a positive integer representing the size of the bag. After that, values in the bag follow in the same line. The values are not sorted in any way (see below).

•You cannot assume (or guess) the number of bags in the input file. In other words, no matter how many bags are stored in the input file, your program should correctly process all of them.

•There may be empty lines at the beginning, in the middle, or at the end of the input file. Your program should smartly skip those empty lines.

The Output File

•The output file is a plain text file (filename: results.txt).

•When your program finds the maximum value in a bag, it writes the maximum value to the output file. Each value should be a separate line in the output file.

About

In this assignment, you are going to write a generic class, Bag. A Bag is a simple container that can hold items. It is unordered. We cannot sort or order items in a Bag. A Bag is homogenous; that is, it can only hold items of a single type.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages