Question: Solve using C + + programming language and full code: Question # 2 : Writing a 'structure' declaration ( 4 pts ) a ) Declare

Solve using C++ programming language and full code:
Question #2: Writing a 'structure' declaration (4pts)
a) Declare a struct type named Event which will describe an item with the following
details:
Title (a string of characters)
Date (a string of characters in the format "YYYY-MM-DD")
Attendees (an integer representing the number of attendees)
Type (an integer where 1 indicates "Workshop" and 2 indicates "Seminar")
isWorkshop (Boolean)// only if the value of Type is "Workshop"
b) Declare event1 as a variable of type Event.
c) Write a function to read the first 4 values (Title, Date, Attendees, and Type) into the
member variables of the Event structure. Pass the struct variable as an argument to the
function. The function should prompt the user in the same order as the items are listed in
the struct.
d) Extend your program to allow the user to enter multiple events' information, asking
each time if they want to add another event. If the response is "no," the program stops
collecting new data. Display all the entered event details on the console, ensuring to
show "attendee" in the singular form if Attendees is 1, and "attendees" in plural form if
Attendees is greater than 1.
Enter event title: Workshop on Data Science
Enter date (YYYY-MM-DD): 2024-03-15
Enter number of attendees: 25
Enter type (1 for Workshop, 2 for Seminar): 1
Event added successfully.
Do you want to enter another event? (yes/no): yes
Enter event title: Machine Learning Seminar
Enter date (YYYY-MM-DD): 2024-05-10
Enter number of attendees: 1
Enter type (1 for Workshop, 2 for Seminar): 2
Event added successfully.
Do you want to enter another event? (yes/no): no
Displaying all events:
Title: Workshop on Data Science, Date: 2024-03-15, Attendees: 25, Type:
Solve using C + + programming language and full

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 Programming Questions!