Question
WRITE IN C!!! a)Write a program which allows a user to maintain a calendar of events in a single day. Your program should allow the
WRITE IN C!!!
a)Write a program which allows a user to maintain a calendar of events in a single day. Your program should allow the user to enter a series of commands which modify and display the calendar. Your program should print out a prompt to indicate that the user can enter a command. Your prompt should be the string $ . At the prompt the user will type a command followed by a set of arguments for the command. When the user enters a command, your program should respond to the command appropriately and then print another prompt to indicate to the user that he/she can enter a new command. This should continue until the user enters quit which should cause your program to end.
You do not need to handle an event which starts at midnight and ends at midnight. For example, you do not need to handle "add e1 0 0".
Your program should accept the following commands:
1.add
2.delete
3.printcalendar This command prints all of the events in the calendar in order by start time.
4.quit This command ends your program
The following is an example of the execution of the calendar program. User inputs are highlighted in bold.
$ add e1 7 9
$ add e2 3 5
$ printcalendar
e2 3 5
e1 7 9
$ add e3 4 6
Event overlap error
$ delete e1
$ printcalendar
e2 3 5
$ quit
b)Use the gcov utility to determine the line coverage produced by executing the program that you wrote for Problem. Execute the program and supply it with a single input, add e1 7 9. Use gcov to compute the statement coverage and to produce the problem.c.gcov 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