0% found this document useful (0 votes)
18 views4 pages

C++ Oop

The document contains two C++ programs: one for a Masjid Information System and another for a Barbing Shop Management System. Each program defines a class to manage details such as name, location, and capacity for the Masjid, and shop name, owner, and location for the Barbing Shop. Both programs include methods to set and display the respective details entered by the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

C++ Oop

The document contains two C++ programs: one for a Masjid Information System and another for a Barbing Shop Management System. Each program defines a class to manage details such as name, location, and capacity for the Masjid, and shop name, owner, and location for the Barbing Shop. Both programs include methods to set and display the respective details entered by the user.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

C++ oop

Abdulai Y Mansaray

23/TEC/CS/136.

Q1. About Masjid

#include <iostream>

#include <string>

using namespace std;

class Masjid {
private:

string name;

string location;

int capacity;

public:

void setDetails(string n, string loc, int cap) {

name = n;

location = loc;

capacity = cap;

void displayInfo() {

cout << "\n=== Masjid Information ===" << endl;

cout << "Name: " << name << endl;

cout << "Location: " << location << endl;


cout << "Capacity: " << capacity << " people" << endl;

};

int main(

cout << "=== Masjid Information System ===" << endl;

cout << "Enter Masjid Name: ";

cin >> name;

cout << "Enter Location: ";

cin >> location;

cout << "Enter Capacity: ";

cin >> capacity;

myMasjid.setDetails(name, location, capacity);

myMasjid.displayInfo();

return 0;

Q2. BarbingShop Management System

#include <iostream>

#include <string>

using namespace std;

class BarbingShop {

private:

string shopName;
string owner;

string location;

public:

void setDetails(string name, string ownerName, string shopLocation) {

shopName = name;

owner = ownerName;

location = shopLocation;

void displayDetails() {

cout << "\n--- Barbing Shop Details ---" << endl;

cout << "Shop Name: " << shopName << endl;

cout << "Owner: " << owner << endl;

cout << "Location: " << location << endl;

};

int main() {

BarbingShop myShop;

string name, owner, location;

cout << "Welcome to Barbing Shop Management System!" << endl;

cout << "\nEnter Shop Name: ";

Cin >> name;

cout << "Enter Owner's Name: ";

Cin >> owner;

cout << "Enter Shop Location: ";


Cin >> location;

myShop.setDetails(name, owner, location);

myShop.displayDetails();

return 0;

You might also like