Question: Can you solve this problem for me: I have this file: Flavor1 Flavor2 Flavor3 Chocolate Vanilla MintChocolateChip Butterscotch Pistachio RainbowSherbet Chocolate Vanilla Strawberry ChocolateChip Mint

Can you solve this problem for me:

I have this file:

Flavor1 Flavor2 Flavor3 Chocolate Vanilla MintChocolateChip Butterscotch Pistachio RainbowSherbet Chocolate Vanilla Strawberry ChocolateChip Mint Strawberry CookiesandCream Vanilla Strawberry RainbowSherbet RainbowSherbet RockyRoad MintChocolateChip Pistachio Mint MintChocolateChip Chocolate Chocolate Vanilla CookieDough Strawberry Vanilla ChocolateChip CookiesandCream Chocolate 

The file contains a list of students' favorite ice cream flavors. The first text in the file is a string header. Each remaining text item is a group of strings representing a student's ice cream choice(s).

File reading - read the data in. Store header in a string variable and each line of data should be stored into a vector of strings. Store the vector from each line into another vector, leaving you with your data stored as a vector>.

Process/Calculations - output the total number of times "Chocolate" was said as a favorite flavor and the total amount of different ice cream flavors on the list (and print those unique flavor names).

create one cin and one cout for this problem. Make sure your code uses the cin.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!