Home > Back-end >  Need help, to do a menu but I don't know how to do
Need help, to do a menu but I don't know how to do

Time:09-25

 # include 
#include

using namespace std;
The class Time
{
Private:
Int hh, mm;
Public:
Void getTime (void);
Void displayTime (void);
};

Void Time: : getTime (void)
{
Cout & lt; <"Enter the time:" & lt; Cout & lt; <"Hours? "; Cin & gt;> hh;
Cout & lt; <"You can? "; Cin & gt;> Mm;

}
Void Time: : displayTime (void)
{
Cout & lt; <"The time is=" & lt;

}
Int main ()
{

Int in;
Char event_title [40].
Cout<" The Welcome Message "& lt; Cout<" Main Menu * * * * * * "& lt; Cout<" "[1] the Add one event & lt; Cout<" "[2] the Delete one event & lt; Cout<" [3] the Add events in batch "& lt; Cout<" [4] Show events "& lt; Cout<" [5] Credits "& lt; Cout<" [6] Exit "& lt; Cout<" * * * * * * * * * * * * * * * * * * "& lt; Cout<" Option (1-6) : "& lt;
Cout<" Select the options from the Main Menu "& lt; Cin> in;

The switch (in)
{

Case 1: cout<" Enter the following information: "& lt; Int the dd, mm, yyyy, et.
Cout<" The Event Title "& lt; Cin> Event_title;
Cout<" The Event Date "& lt; Cin> Dd> Mm> Yyyy;
If (yyyy>=1900 & amp; & Yyyy<=9999)//check year
{
//check the month
If (mm>=1 & amp; & Mm<=12)
{
//check days
If ((dd>=1 & amp; & Dd<=31) & amp; & Mm==(1 mm==| | 3 | |==5 mm | |==7 mm | |==8 mm | |==10 mm | |==12 mm))
CoutElse if ((dd>=1 & amp; & Dd<=30) & amp; & (4 mm==| |==6 mm | | 9 mm==| |==11 mm))
CoutElse if ((dd>=1 & amp; & Dd<=28) & amp; & (==2 mm))
CoutElse if (dd==29 & amp; &==2 mm & amp; & (yyyy %==0 400 | | (yyyy % 4==0 & amp; & Yyyy % 100!
=0)))CoutThe else
Cout<" The date is invalid "& lt; }
The else
{
Printf (" the Month is not valid. \ n ");
}
}
The else
{
Printf (" Year is not valid. \ n ");
}
Cout<" The Event Start time "& lt; Time T;//creating objects
T.g etTime ();
T.d isplayTime ();
CoutCout<" The Event End time "& lt; T.g etTime ();
T.d isplayTime ();
CoutCout<" The Event Type "& lt; Cin> et; Home//(1) (2) the Work Study (3) (4) Play
The main ();

break;

Case 2: cout<" Enter the date of the event that you want to be does "& lt; Cin> Dd> Mm> Yyyy;
If (yyyy>=1900 & amp; & Yyyy<=9999)//check year
{
//check the month
If (mm>=1 & amp; & Mm<=12)
{
//check days
If ((dd>=1 & amp; & Dd<=31) & amp; & Mm==(1 mm==| | 3 | |==5 mm | |==7 mm | |==8 mm | |==10 mm | |==12 mm))
Cout<" The Event is does "& lt; Else if ((dd>=1 & amp; & Dd<=30) & amp; & (4 mm==| |==6 mm | | 9 mm==| |==11 mm))
Cout<" The Event is does "& lt; Else if ((dd>=1 & amp; & Dd<=28) & amp; & (==2 mm))
Cout<" The Event is does "& lt; Else if (dd==29 & amp; &==2 mm & amp; & (yyyy %==0 400 | | (yyyy % 4==0 & amp; & Yyyy % 100!
=0)))Cout<" The Event is does "& lt; The else
Cout<" The date is invalid "& lt; }
The else
{
Printf (" the Month is not valid. \ n ");
}
}
The else
{
Printf (" Year is not valid. \ n ");
}
The main ();

Case 3: cout<" Add the events in the batch "& lt; //the Format of one event is DD - MM - MM/hh - MM/YYYY/hh - the event Title/X
Cout<" The Event Date "& lt; Cin> Dd> Mm> Yyyy;
If (yyyy>=1900 & amp; & Yyyy<=9999)//check year
{
//check the month
If (mm>=1 & amp; & Mm<=12)
{
//check days
If ((dd>=1 & amp; & Dd<=31) & amp; & Mm==(1 mm==| | 3 | |==5 mm | |==7 mm | |==8 mm | |==10 mm | |==12 mm))
CoutElse if ((dd>=1 & amp; & Dd<=30) & amp; & (4 mm==| |==6 mm | | 9 mm==| |==11 mm))
CoutElse if ((dd>=1 & amp; & Dd<=28) & amp; & (==2 mm))
CoutElse if (dd==29 & amp; &==2 mm & amp; & (yyyy %==0 400 | | (yyyy % 4==0 & amp; & nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related