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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started