Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
100%

Suppose you have a file Monster.txt that lists the Monster Energy Drinks the company offers, on one line and the price for a case of 24, with the  customer ratings on a scale of 1-5 on the second line. 

 

The following shows the first few lines of the file:

 

Monster Energy Nitro Super Dry Maximum Strength Drink

39.99 4.5

Monster Energy Ultra Red, Sugar Free Energy Drink

39.99 5

Red Bull Energy Drink, Zero

92.23 4.5

Red Bull Energy Drink, Coconut Berry

41.18 5

Monster Energy Juice, Pipeline Punch

34.98 5

Red Bull Energy Drink, Coconut Berry

41.18 5

The first line means the drink name is: Monster Energy Nitro Super Dry Maximum Strength and the second line means that a case of 24 cost $39.99 and it was rated 4.5/5. 

 

NOTE: WE DO NOT KNOW HOW MANY LINES THERE ARE IN THE FILE. 

 

Write the C++ program (with comments) that reads the data from the file, lists only those drinks rated 5 stars, and indicates if the five star drink comes with a free six pack or not.

The customer gets a free six pack if the price of a carton of 24 is greater than $39.99. Write a function that will determines whether the customer will get a “free six pack”.

 

If the file has ONLY the lines above, the output would be: 

​Five Star Drinks: 

Monster Energy Ultra Red, Sugar Free Energy Drink 39.99

Red Bull Energy Drink, Coconut Berry       41.18      free six pack

Monster Energy Juice, Pipeline Punch    34.98

Red Bull Energy Drink, Coconut Berry    41.18     free six pack

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY