Question: Question # 2 : Writing a structure declaration ( 4 pts ) a ) Declare a struct type named Event which will describe an item

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.

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!