الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

من يحاول مساعدتي

مغلق
بدأه ابويعقوب في 25 مايو 2008 · 0 رد · 305 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1

السلام عليكم ورحمة الله وبركاته،،،

ياشباب الله يجزاكم بالخير ، أنا عندي برنامج ماأعرف حل واتمنى مساعدتي .

ياليت ياشباب أذا أحد يستطيع مساعدتي اليوم أو بكره

في شخص عطاني هذا الموقع وقال إن شاء الله إن في شباب يحلون البرامج .

ومعليش ياشباب أنا ادرس c++ بس أني معرفت أحل البرنامج

The aim of this project is to program an agenda for one week. In this agenda, we can do the following

operations:

1- Add one appointment

2- Add 3 appointments

3- Print the agenda

4- Print agenda of one day

Data structures (You are not allowed to modify the following data structures)

Global types and constants:

enum EnumDays {Saturday, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday};

const char *StrDays[] = {"Saturday", "Sunday", "Monday", "Tuesday", "Wednesday",

"Thursday", "Friday"};

const int NBHOURS = 24; // 24 hours a day

const int NBDAYS = 7; // 7 days a week

const int MAX_APPOINTMENTS = 168; // A maximum of one appointment per hour dayly

const int MAX_APPOINTMENT_LENGTH = 50;

Local variable to the main function:

int Agenda[NBHOURS][NBDAYS]; // 24 hours a day, 7 days a week

char AppointmentLabels[MAX_APPOINTMENTS][MAX_APPOINTMENT_LENGTH];

int nbAppointments;

Description of functions to be implemented

• void InitAgenda(int agenda[NBHOURS][NBDAYS]);

initialises all elements to -1

• void ReadAnAppointment(char *label, EnumDays &d, int &sh, int &duration);

Reads the appointment label in label, the day in d, start hour in sh, and the duration in duration.

You should make all the necessary validations (any appointment must starts and finishes in the

same day, the duration of an appointment should be no less than 1, and no more than 24 hours, etc.)

• void AddAppointment(char *label, EnumDays d, int sh, int duration, int

Agenda[NBHOURS][NBDAYS], char

appointmentLabels[MAX_APPOINTMENTS][MAX_APPOINTMENT_LENGTH],int &nbAppointments);

This function adds the appointment (label, day, start hour, and duration) to the agenda. The index of

the label in the AppointmentLabels array should be putted as the value in the Agenda array in the

corresponding day and hours.

• void PrintAgenda(const int Agenda[NBHOURS][NBDAYS], const char

AppointmentLabels[MAX_APPOINTMENTS][MAX_APPOINTMENT_LENGTH], int nbAppointments)

This function prints the full week agenda (7 days, 24 hours a day). The format of the output should

be exactly like the project demo.

• void PrintDayAppointment(EnumDays d, const int Agenda[NBHOURS][NBDAYS],

const char AppointmentLabels[MAX_APPOINTMENTS][MAX_APPOINTMENT_LENGTH])

This function prints the appointments for a specified day. The format of the output should be

exactly like the project demo.

• int main()

The program should act like project demo in all aspects.

هذا الموضوع مغلق.

مواضيع مشابهة