0% found this document useful (0 votes)
39 views

oop Complex Engineering problem (1)

Uploaded by

Hamza Bilal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

oop Complex Engineering problem (1)

Uploaded by

Hamza Bilal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Complex Engineering problem

Group Members: -
Muhammad Hasham (190453)
Inshal (190415)
Abdul Rasheed (190419)

Bachelor of Electrical Engineering


(2019-2023)
Course Incharge: -
Ma’am Hafsa

DEPARTMENT OF ELECTRICAL AND COMPUTER


ENGINEERING
FACULTY OF ENGINEERING
AIR UNIVERSITY, ISLAMABAD
Complex Engineering Problem:
Code
#include<iostream>
using namespace std;

class Members {
private:
int mem_id;
string name;
string address;
string department;
string contact_no;

public:
Members() {
mem_id = 0;
name = "";
address = "";
department = "";
contact_no = "";
}
void set_Members(int m, string n, string a, string d, string c) {
mem_id = m;
name = n;
address = a;
department = d;
contact_no = c;

void setNullMember() {
mem_id = 0;
name = "";
address = "";
department = "";
contact_no = "";
}

void set_memId(int m_id) {


mem_id = m_id;
}
void set_name(string n) {
name = n;;
}
void set_address(string add) {
address = add;
}
void set_dept(string d) {
department = d;
}
void set_contact(string c) {
contact_no = c;
}

int get_memberid() {
return mem_id;
}

string get_name() {
return name;
}
string get_address() {
return address;
}
string get_dept() {
return department;
}
string get_contact() {
return contact_no;
}

};
class Events {
private:
string event_name;
string event_date;

public:
Events() {
event_name = "";
event_date = "";
}
void set_Events(string en, string ed) {
event_name = en;
event_date = ed;
}
void setNullEvents() {
event_name = "";
event_date = "";
}

void set_eventName(string en) {


event_name = en;
}
void set_eventDate(string ed) {
event_date = ed;
}

string get_eventName() {
return event_name;
}
string get_eventDate() {
return event_date;
}

};

int main() {
Events event[100];
Members mem[100];
char main_inp;
int loop = 0;
int x, y, z;
string j, k;
int member_count = 0;
int event_count = 0;
int i = 0;

int member_id;
string mem_name, mem_add, mem_department, mem_contact;

string e_name, e_date;


cout << "Welcome to the University Event Management System\n" << endl;

while (loop < 1) {


cout << "Select from: \n1: Members \n2:Events" << endl;
cin >> main_inp;
switch (main_inp) {
case '1':
cout << "\n1: Add Member \n2: Delete Member \n3: Show Members \n4: Edit Members" << endl;
cin >> x;
if (x == 1) {
cout << "Enter Member id" << endl;
cin >> member_id;
cout << "Enter Member Name" << endl;
cin >> mem_name;
cout << "Enter Member address" << endl;
cin >> mem_add;
cout << "Enter Member Department" << endl;
cin >> mem_department;
cout << "Enter Member Contact" << endl;
cin >> mem_contact;

mem[member_count].set_Members(member_id, mem_name, mem_add, mem_department,


mem_contact);
member_count++;
}
else if (x == 2) {
cout << "Members are:\n" << endl;
do{
cout << "Member ID: " << mem[i].get_memberid() << endl;
cout << "Member Name: " << mem[i].get_name() << endl;
cout << "Member Address: " << mem[i].get_address() << endl;
cout << "Member Department: " << mem[i].get_dept() << endl;
cout << "Member Contact: " << mem[i].get_contact() << endl;

cout << endl << endl << endl;


i++;
} while (i < member_count);
i = 0;
cout << "Enter Member ID that you want to delete" << endl;
cin >> y;

for (int i = 0; i++; i <= member_count) {


if (mem[i].get_memberid() == y) {
mem[i].setNullMember();
}
else {
cout << "Member with this ID not found!" << endl;
}
}
}
else if (x == 3) {
cout << "Members are:\n" << endl;
do{
cout << "Member ID: " << mem[i].get_memberid() << endl;
cout << "Member Name: " << mem[i].get_name() << endl;
cout << "Member Address: " << mem[i].get_address() << endl;
cout << "Member Department: " << mem[i].get_dept() << endl;
cout << "Member Contact: " << mem[i].get_contact() << endl;

cout << endl << endl << endl;


i++;
} while (i<member_count);
i = 0;
}

else if (x == 4) {
cout << "Members are:\n" << endl;
do {
cout << "Member ID: " << mem[i].get_memberid() << endl;
cout << "Member Name: " << mem[i].get_name() << endl;
cout << "Member Address: " << mem[i].get_address() << endl;
cout << "Member Department: " << mem[i].get_dept() << endl;
cout << "Member Contact: " << mem[i].get_contact() << endl;

cout << endl << endl << endl;


i++;
} while (i < member_count);
i = 0;
cout << "Which member you want to edit? Enter their ID" << endl;
cin >> y;
do{
if (mem[i].get_memberid() == y) {
cout << "Enter what you want to edit from the list below: " << endl;
cout << "\n1: Name \n2: Address \n3: Department \n4: Contact" << endl;
cin >> z;

if (z == 1) {
cout << "Enter new name: " << endl;
cin >> mem_name;
mem[i].set_name(mem_name);
}
else if (z == 2) {
cout << "Enter new address: " << endl;
cin >> mem_add;
mem[i].set_address(mem_add);
}
else if (z == 3) {
cout << "Enter new department: " << endl;
cin >> mem_department;
mem[i].set_dept(mem_department);
}
else if (z == 4) {
cout << "Enter new contact_no: " << endl;
cin >> mem_contact;
mem[i].set_contact(mem_contact);
}
cout << "New info of member: " << endl;
cout << "Member ID: " << mem[i].get_memberid() << endl;
cout << "Member Name: " << mem[i].get_name() << endl;
cout << "Member Address: " << mem[i].get_address() << endl;
cout << "Member Department: " << mem[i].get_dept() << endl;
cout << "Member Contact: " << mem[i].get_contact() << endl;

cout << endl << endl << endl;


}
else {
cout << "Member with this ID not found!" << endl;
}
i++;
} while (i < member_count);
i = 0;
}
break;
case '2':
cout << "\n1: Add Event \n2: Delete Event \n3: Show Event \n4: Edit Event" << endl;
cin >> x;
if (x == 1) {
cout << "Enter Event name" << endl;
cin >> e_name;
cout << "Enter Event Date" << endl;
cin >> e_date;

event[event_count].set_Events(e_name, e_date);
event_count++;

}
else if (x == 2) {
cout << "Events are:\n" << endl;
do{

cout << "Event Name: " << event[i].get_eventName() << endl;


cout << "Event Date: " << event[i].get_eventDate() << endl;

cout << endl << endl << endl;


i++;
} while (i < event_count);
i = 0;
cout << "Enter Event Name that you want to delete" << endl;
cin >> j;

do{
if (event[i].get_eventName() == j) {
event[i].setNullEvents();
}
else {
cout << "Event with this name not found!" << endl;
}
i++;
} while (i < event_count);
i = 0;
}
else if (x == 3) {
cout << "Events are:\n" << endl;
do {

cout << "Event Name: " << event[i].get_eventName() << endl;


cout << "Event Date: " << event[i].get_eventDate() << endl;

cout << endl << endl << endl;


i++;
} while (i < event_count);
i = 0;
}
else if (x == 4) {
cout << "Events are:\n" << endl;
do {

cout << "Event Name: " << event[i].get_eventName() << endl;


cout << "Event Date: " << event[i].get_eventDate() << endl;
cout << endl << endl << endl;
i++;
} while (i < event_count);
i = 0;
cout << "Which event you want to edit? Enter their name" << endl;
cin >> k;

do{
if (event[i].get_eventName() == k) {
cout << "Enter what you want to edit about the event: " << endl;
cout << "\n1: Event Name \n2: Event Date" << endl;
cin >> z;

if (z == 1) {
cout << "Enter new name of event" << endl;
cin >> e_name;
event[i].set_eventName(e_name);
}
else if (z == 2) {
cout << "Enter new date of event" << endl;
cin >> e_date;
event[i].set_eventDate(e_date);
}

}
else {
cout << "Event with this name not found!" << endl;
}
i++;
} while (i < event_count);
i = 0;
}
break;

default:
cout << "Wrong input entered. Try again" << endl;
}
}

return 0;
}
Output:
CONCLUSION:
The university Event management system allows the administrator to store
the detail of events and user detail the implimation of the system will reduce the
data entry course time and also provide readily calculated reports this website
provide a computerize system that will benefit the students as well as the staff of
the university it also has a facility for teacher to login and also can add and
maintain University event.

You might also like