WS04/part 1/data.txt # ID : Name , XXXXXXXXXXemail, # of people, Day, Time #------------------------------------------------------------ 1234: John , XXXXXXXXXX , XXXXXXXXXX, 3, 5 ab defghij: David ,...

1 answer below »
This link has what i have to do :https://github.com/Seneca-345305/OOP-Workshops/tree/main/WS04


WS04/part 1/data.txt # ID : Name , email, # of people, Day, Time #------------------------------------------------------------ 1234: John , [email protected] , 2, 3, 5 ab defghij: David , [email protected] , 1 , 4, 6 RES-003 : Sara , [email protected] , 2 , 5, 7 RES-004: Ana , [email protected] , 1 , 5 , 8 RES-005: John , [email protected] , 1 , 4 , 9 RES-006: Vanessa , [email protected], 2 , 3, 10 RES 007: Mike , [email protected] , 4 ,4, 11 RES-008: Mike , [email protected] , 8 , 5, 12 RES-009: Dan , [email protected] , 2 , 3, 13 RES-010: Donna , [email protected] , 5 , 5,14 RES-011: Ana , [email protected] , 4 , 4, 15 RES-012: Jon Snow , [email protected] ,2 , 5, 16 RES-013: Sara , [email protected] , 6, 3, 17 RES-014: Jennifer,[email protected],6,5,18 RES-015 :Stan , [email protected] , 5, 4, 19 RES-016: Chris , [email protected],3 , 4, 20 RES-017: Vanessa , [email protected], 4, 4, 21 RES-018: David , [email protected] , 4, 5, 22 RES-019: Chris , [email protected] , 1, 3, 23 RES-020: Donna , [email protected] , 3, 4, 24 WS04/part 1/sample_output.txt Command Line: -------------------------- 1: ws 2: data.txt -------------------------- Reservations -------------------------- Reservation 1234: John Drinks on day 3 @ 5:00 for 2 people. Reservation ab defghij: David Breakfast on day 4 @ 6:00 for 1 person. Reservation RES-003: Sara Breakfast on day 5 @ 7:00 for 2 people. Reservation RES-004: Ana Breakfast on day 5 @ 8:00 for 1 person. Reservation RES-005: John Breakfast on day 4 @ 9:00 for 1 person. Reservation RES-006: Vanessa Drinks on day 3 @ 10:00 for 2 people. Reservation RES 007: Mike Lunch on day 4 @ 11:00 for 4 people. Reservation RES-008: Mike Lunch on day 5 @ 12:00 for 8 people. Reservation RES-009: Dan Lunch on day 3 @ 13:00 for 2 people. Reservation RES-010: Donna Lunch on day 5 @ 14:00 for 5 people. Reservation RES-011: Ana Lunch on day 4 @ 15:00 for 4 people. Reservation RES-012: Jon Snow Drinks on day 5 @ 16:00 for 2 people. Reservation RES-013: Sara Dinner on day 3 @ 17:00 for 6 people. Reservation RES-014: Jennifer Dinner on day 5 @ 18:00 for 6 people. Reservation RES-015: Stan Dinner on day 4 @ 19:00 for 5 people. Reservation RES-016: Chris Dinner on day 4 @ 20:00 for 3 people. Reservation RES-017: Vanessa Dinner on day 4 @ 21:00 for 4 people. Reservation RES-018: David Drinks on day 5 @ 22:00 for 4 people. Reservation RES-019: Chris Drinks on day 3 @ 23:00 for 1 person. Reservation RES-020: Donna Drinks on day 4 @ 24:00 for 3 people. -------------------------- Updated Reservations -------------------------- Reservation 1234: John Breakfast on day 7 @ 6:00 for 2 people. Reservation ab defghij: David Breakfast on day 4 @ 6:00 for 1 person. Reservation RES-003: Sara Breakfast on day 6 @ 6:00 for 2 people. Reservation RES-004: Ana Breakfast on day 5 @ 8:00 for 1 person. Reservation RES-005: John Breakfast on day 4 @ 9:00 for 1 person. Reservation RES-006: Vanessa Drinks on day 3 @ 10:00 for 2 people. Reservation RES 007: Mike Lunch on day 4 @ 11:00 for 4 people. Reservation RES-008: Mike Lunch on day 5 @ 12:00 for 8 people. Reservation RES-009: Dan Lunch on day 3 @ 13:00 for 2 people. Reservation RES-010: Donna Lunch on day 5 @ 14:00 for 5 people. Reservation RES-011: Ana Lunch on day 4 @ 15:00 for 4 people. Reservation RES-012: Jon Snow Drinks
Answered 1 days AfterOct 08, 2021

Answer To: WS04/part 1/data.txt # ID : Name , XXXXXXXXXXemail, # of people, Day, Time...

Kamal answered on Oct 09 2021
134 Votes
#include
#include
#include
using namespace std;
namespace sdds
{
class Reservation
{
private:
char ID[100];
string NAME;
string EMAIL;
int PARTY_SIZE;
int DAY;
int HOUR;
public:
Reservation() {}

void update(int day, int time)
{
this->DAY = day;
this->HOUR = time;
}
Reservation(const string& res)
{
char str[100];
strcpy(str, res.c_str());
char *temp = strtok(str, ",");
int count = 0;
while (temp != NULL)
{
count++;
if(count == 1 || count == 2)
{
char str1[50];
char *temp2 = strtok(str1, ":");
while (temp2 !=...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here