Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 . 5 Problem 5 Problem: Book club members meet regularly for coffee at a round cafe table. Only a few members turn up randomly
Problem
Problem: Book club members meet regularly for coffee at a round cafe table. Only a few members turn up randomly each time. It is a good thing that they keep records of who comes to each meeting, because one of them has been diagnosed with contagious book fever. It is very likely that if you sit next to someone with book fever, you will catch book fever.
The file meetingstxt contains the first names of all the attendees at each meeting, in the order they sat around the table. It contains:
Chuck Trevor
Zack Olive Xander Ephraim
Ralph Wendy Ephraim Grace Leslie Phil Kathy
Binh Harry Ralph Xander Zack Chuck Uma Suzy Phil Kathy
Neville Leslie Kathy
Neville Harry Binh Vince Xander Zack Quisha Olive Phil
Yvonne Uma Trevor Fran Olive Phil Kathy
Harry Ralph Ephraim Denise Quisha Grace Phil
Binh Mandy Xander Ephraim Leslie Olive Fran
John Olive Chuck Mandy
Poor Harry, at meeting number is marked with an asterisk because we know he was infected with book fever then.
Write a program that reports the names and number of club members infected up to each meeting from the first meeting where anyone was infected, like this:
Enter file name: meetingstxt
Harry Neville Binh
Harry Neville Binh
Harry Neville Binh Ralph Phil
Harry Neville Binh Ralph Phil Mandy Fran
Harry Neville Binh Ralph Phil Mandy Fran John Chuck
The program should work in general for any such file with exactly one name marked with an asterisk. The file meetingstxt should produce this output.
Phil Andrew Kathy
Phil Andrew Kathy
Phil Andrew Kathy Ephraim Harry
Phil Andrew Kathy Ephraim Harry
Phil Andrew Kathy Ephraim Harry
Phil Andrew Kathy Ephraim Harry
Phil Andrew Kathy Ephraim Harry Suzy Leslie
Answer: Copy your code in the space given below and insert screenshots of your program output for the following scenario:
Use the file Pvtxt as the source file.
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