Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions C++/matrix_addition.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#include <iostream>
using namespace std;

class Matrix{
public:
int mat[2][2];

Matrix()
{
mat[0][0]=1;
mat[0][1]=1;
mat[1][0]=1;
mat[1][1]=1;
}

Matrix(int a, int b, int c, int d)
{
mat[0][0]=a;
mat[0][1]=b;
mat[1][0]=c;
mat[1][1]=d;
}

Matrix addmat(Matrix s ,Matrix t)
{
Matrix r;
r.mat[0][0]=s.mat[0][0]+t.mat[0][0];
r.mat[0][1]=s.mat[0][1]+t.mat[0][1];
r.mat[1][0]=s.mat[1][0]+t.mat[1][0];
r.mat[1][1]=s.mat[1][1]+t.mat[1][1];
return r;
}

void display()
{
cout<<mat[0][0]<<" "<<mat[0][1]<<endl<<mat[1][0]<<" "<<mat[1][1]<<endl;
}

~Matrix()
{
cout<<endl<<" Executing destructor";
}
};

main()
{
Matrix s1,s2,s3,s4(2,4,6,8),s5(3,5,7,9),s6;


cout<<endl<<"Default constructor: "<<endl;
s3 = s3.addmat(s1,s2);
cout<<endl<<"Matrix 1: "<<endl;
s1.display();
cout<<endl<<"Matrix 2: "<<endl;
s2.display();
cout<<"Sum of Matrix 1 and Matrix 2 is: "<<endl;
s3.display();

cout<<endl<<"Paramater constructor: "<<endl;
s6 = s6.addmat(s4,s5);
cout<<endl<<"Matrix 1: "<<endl;
s4.display();
cout<<endl<<"Matrix 2: "<<endl;
s5.display();
cout<<"Sum of Matrix 1 and Matrix 2 is: "<<endl;
s6.display();

}

150 changes: 150 additions & 0 deletions C++/medical_billing.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
#include <iostream>
#include <stdlib.h>
using namespace std;

class patient{
public:
string patientID;
string PName;

void getPatientInfo();
void putPatientInfo();
void makeAppointment();
void Diagnosis();
void Billing();
void printBill();

private:
string Address;
string Gender;
int Phone;
string BloodGroup;
string doctor_Name;
string app_date;
string DiagnosisInfo;
string MedicineInfo;
float doctorFee;
float medicine_charge;
float Total;
};

void patient :: getPatientInfo()
{
cout<<endl<<"Kindly enter patient ID: ";
cin>>patientID;
cout<<"Kindly enter patient name: ";
cin>>PName;
cout<<"Kindly enter patient address: ";
cin>>Address;
cout<<"Kindly enter patient gender: ";
cin>>Gender;
cout<<"Kindly enter patient phone number: ";
cin>>Phone;
cout<<"Kindly enter patient blood group: ";
cin>>BloodGroup;
}

void patient :: putPatientInfo()
{
cout<<endl<<"Patient ID: "<<patientID;
cout<<endl<<"Patient Name: "<<PName;
cout<<endl<<"Patient Address: "<<Address;
cout<<endl<<"Patient Gender: "<<Gender;
cout<<endl<<"Patient Phone Number: "<<Phone;
cout<<endl<<"Patient Blood Group: "<<BloodGroup<<endl;
}

void patient :: makeAppointment()
{
cout<<endl<<"Kindly enter Doctor Name: ";
cin>>doctor_Name;
cout<<"Kindly enter Appointment Date: ";
cin>>app_date;
}

void patient :: Diagnosis()
{
cout<<endl<<"Kindly enter Diagnosis Info: ";
cin>>DiagnosisInfo;
cout<<"Kindly enter Medicine Info: ";
cin>>MedicineInfo;
}

void patient :: Billing()
{
cout<<endl<<"Kindly enter Doctor Fee: ";
cin>>doctorFee;
cout<<"Kindly enter Medicine Charges: ";
cin>>medicine_charge;
Total=doctorFee+medicine_charge;
}

void patient :: printBill()
{
cout<<endl<<"Medical Bill";
cout<<endl<<"------------";
cout<<endl<<"Patient ID: "<<patientID<<endl;
cout<<endl;
cout<<"1.Doctor Fees: "<<doctorFee<<endl;
cout<<"2.Medicine Charges: "<<medicine_charge<<endl;
cout<<endl;
cout<<"Total: "<<Total<<endl;
cout<<"Thank you"<<endl;
}

int main()
{
int choice;
patient obj;


cout<<endl<<" MEDICAL CLINIC MENU";
cout<<endl<<" -------------------";
cout<<endl<<"1.Get Patient Info \t 2.Put Patient Info"<<endl;
cout<<"3.Make Appointment \t 4.Diagnosis "<<endl;
cout<<"5. Billing \t 6. print Bill "<<endl;
cout<<"7.Exit"<<endl;

while(1)
{
cout<<endl<<"Kindly enter your choice: ";
cin>>choice;

switch(choice) {

case 1:
obj.getPatientInfo();
break;

case 2:
obj.putPatientInfo();
break;

case 3:
obj.makeAppointment();
break;

case 4:
obj.Diagnosis();
break;

case 5:
obj.Billing();
break;

case 6:
obj.printBill();
break;

case 7:
cout<<endl<<"Sucessfully exiting. Thank you. "<<endl;
exit(0);

default:
cout<<endl<<"Invalid choice. "<<endl;
break;
}
}
}


Loading