Question 1:

Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and
Monthly. An appointment has a description (for example, “see the dentist”) and a date
and time. Write a virtual function occurs_on(int year, int month, int day) that checks
whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of
Appointment* with a mixture of appointments. Have the user enter a date and print out
all appointments that happen on that date.

*This Should Be Done IN C++


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C++ Code Interview Questions

Algorithm in O(2n) Presently we can solve in our hypothetical machine problem instances of size 100 in 1 minute using algorithm A, which is a O(2n). We would like to solve instances of size 200 in 1 minute using algorithm A on a new machine. What is the speed of the new machine should be?

2 Answers   ABC, Qatar University,


Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and calculate its complexity T(n).

1 Answers   Infosys, Qatar University,


Write a simple encryption program using string function which apply the substitution method.

0 Answers  


Wrie a function which returns the most frequent number in a list of integers. Handle the case of more than one number which meets this criterion. public static int[] GetFrequency(int[] list)

3 Answers   Nagarro,


Code for Two Classes for Doing Gzip in Memory?

0 Answers  






How reader and writer problem was implemented and come up with effective solution for reader and writer problem in case we have n readers and 1 writer.

6 Answers   Microsoft, NetApp,


write a program that calculate the volume of cylinder after user enters radius and height and show the algorithm used

1 Answers   Jomo Kenyatta University,


Write A C++ Program To Input A Number Between 20 To 99 And Display Its Numbername?

3 Answers   TCS,


How to Split Strings with Regex in Managed C++ Applications?

0 Answers   Microsoft,


Here's the programm code: int magic(int a, int b) { return b == 0 ? a : magic(b, a % b); } int main() { int a, b; scanf("%d%d", &a, &b); printf("%d\n", magic(a, b)); return 0; } on input stream we have integers 4, 45 What's the output integer? How many times will be initiated "magic" function?

1 Answers  


We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

0 Answers  


write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

0 Answers   Jomo Kenyatta University,


Categories