Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
#include<conio.h>
#include<fstream>
#include<stdio.h>
#include<stdlib.h>
#include<dos.h>
using namespace std;
class hotel
{
int nr_dhomes;
char emri[30];
char adresa[50];
char celular[10];
public:
void menuja_kryesore();
void shto();
void shfaq();
void dhomat();
void ndrysho();
int kontrollo(int);
void modifiko(int);
void fshij_rezultate(int);
void fatura(int);
};
void hotel::menuja_kryesore()
{
int zgjedhja;
while(zgjedhja!=5)
{
system("cls");
cout<<"/n/t/t/t/t *************************";
cout<<"/n/t/t/t/t Menaxhim hoteli";
cout<<"/n/t/t/t/t * Menuja kryesore *";
cout<<"/n/t/t/t/t *************************";
cout<<"/n/n/n/t/t/t 1.Rezervo nje dhome";
cout<<"/n/t/t/t 2.Te dhenat e klientet";
cout<<"/n/t/t/t 3.Dhomat e zena";
cout<<"/n/t/t/t 4.Ndrysho te dhenat";
cout<<"/n/t/t/t 5.Dil";
cout<<"/n/n/t/t/t Zgjidh: ";
cin>>zgjedhja;
switch(zgjedhja)
{
case 1: shto();
break;
case 2: shfaq();
break;
case 3: dhomat();
break;
case 4: ndrysho();
break;
case 5: break;
default:
{
cout<<"/n/n/t/t/t zgjedhja gabuar.....!!!";
cout<<"/n/t/t/tShtyp nje buton....!!";
getch();
}
}
}
}
void hotel::shto()
{
system("cls");
int r,flag;
ofstream fout("Hotel.txt",ios::app);
cout<<"/n Hidh te dhenat e klientit";
cout<<"/n ----------------------";
cout<<"/n/n Nr dhomes: ";
cout<<"/n Nr i dhomes 0- 50";
cout<<"/n Dhoma normale 1 - 30";
cout<<"/n Dhoma lux 31 - 45";
cout<<"/n Dhoma royal 46 - 50";
cout <<"/n Vendos nr e dhomes ne te cilen do te qendroni :- "<<endl;
cin>>r;
flag=kontrollo(r);
if(flag)
cout<<"/n Na vjen keq! Dhoma eshte e zene!";
else
{
nr_dhomes=r;
cout<<" Emri: ";
cin>>emri;
cout<<" Adresa: ";
cin>>adresa;
cout<<" Nr Celularit: ";
cin>>celular;
fout.write((char*)this,sizeof(hotel));
cout<<"/n Dhoma eshte rezervuar...!!!";
}
cout<<"/n Shtyp nje button.....!!";
getch();
fout.close();
void hotel::shfaq(){
system("cls");
ifstream fin("Hotel.txt",ios::in);
int r,flag;
cout<<"/n Vendos nr e dhomes per te pare te dhenat e klientit :-"<<endl;
cin>>r;
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
if(nr_dhomes==r)
{
system("cls");
cout<<"/n Te dhenat e klientit";
cout<<"/n -----------------";
cout<<"/n/n Nr i dhomes "<<nr_dhomes;
cout<<"/n Emri "<<emri;
cout<<"/n Adresa "<<adresa;
cout<<"/n Nr i cel "<<celular;
flag=1
break;
}
}
if(flag==0)
cout<<"/n Na vjen keq nuk u gjend nr i dhomes.....!!";
cout<<"/n/n Shtypni nje buton per te vazhduar.....!!";
getch();
fin.close();
}
}
void hotel::dhomat(){
system("cls")
ifstream fin("Hotel.txt",ios::in);
cout<<"Lista e dhomave te zena"<<endl;
cout<<endl;
cout<<"/n Nr i dhomes /t /t Emri i klientit /t /t Adresa /t /t Nr Celularit"<<endl;
while(!fin.eof()){
fin.read((char*)this,sizeof(hotel));
cout<<nr_dhomes<<"/t /t"<<emri<<"/t /t"<<adresa<<"/t /t"<<celulari<<endl;
}
cout<<"/n /n /t /t"<<Shtyp nje buton per te dal<<endl;
getch();
fin.close();
}
void hotel::ndrysho(){
system("cls")
int zgjedje,r;
cout<<"MENU"<<endl;
cout<<"/n 1.Ndrysho te dhenat e klientit"<<endl;
cout<<"/n 2.Fshi klientin"<<endl;
cout<<"/n 3.Fatura e klientit"<<endl;
cout<<"/n Beni zgjedhjen tuaj"<<endl;
cin>>zgjedhje;
cout<<"/n Zgjidh nr e dhomes"<<endl;
switch(zgjedhja): {
case 1:modifiko(r);
break;
case 2:fshij_rezultate(r);
break;
case 3:fatura(r);
break;
default:
cout<<"Zgjedhje e gabuar";
}
cout<<"/n Shtyp nje buton per te vazhduar"<<endl;
getch ();
}
int hotel::kontrollo(int r){
int flag=0;
ifstream fin("Hotel.txt",ios::in);
while(!fin.eof())
{
fin.read((char*)this,sizeof(hotel));
if (nr_dhomes==r){
flag==1;
break;
}}
fin.close();
return(flag);
}
void hotel::modifiko(int r){
int pos,flag=0;
fstream file("Hotel.txt",ios::in|ios::out);
while(!fin.eof()){
pos=file.tellg();
file.read((char*)this,sizeof(hotel));
if (nr_dhomes==r){
cout<<"Vendos te dhenat e reja per klientin"<<endl;
cout<<endl;
cout<<" Emri: ";
cin>>emri;
cout<<" Adresa: ";
cin>>adresa;
cout<<" Nr Celularit: ";
cin>>celular;
file.seekpg(pos);
file.read((char*)this,sizeof(hotel));
cout<<"Te dhenat u modifikuan me sukses"<<endl;
flag=1;
break;
}
}
}
void hotel::fshij_rezultate(){
system("cls")
cout<<""<<emri<<endl;
cout<<""<<adresa<<endl;
cout<<""<<celular<<endl;
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team