Question: Question # 2 : Writing a structure declaration ( 4 pts ) a ) Declare a struct type named Event which will describe an item
Question #: Writing a structure declaration pts
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 YYYYMMDD
Attendees an integer representing the number of attendees
Type an integer where indicates "Workshop" and indicates "Seminar"
isWorkshop Boolean only if the value of Type is "Workshop"
b Declare event as a variable of type Event.
c Write a function to read the first 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 and "attendees" in plural form if Attendees is greater than
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
