Friday, January 2, 2009

MOBILE OS(C++)

C++ PROJECT (FOR CLASS 12)

DOWNLOAD LINK::http://rapidshare.com/files/179680720/_INSTALL_BOSS_MOBILE.exe.html
(By KRISHNADAS)
DOWNLOAD BOSS MOBILE (MY C++ PROJECT FROM THE FOLLOWING LINK:
{http://rapidshare.com/files/179680720/_INSTALL_BOSS_MOBILE.exe.html}
-(MINI )MOBILE OPERATING SYSTEM -"BOSS MOBILE os 007"
- TURBO C++ VERSION 3.0
- MAINLY -FILE HANDLING IS IMPLEMENTED

-THIS PROGRAM HAS:
* 11 NOTEPADS ARE REQUIRED(11 TEXT FILES)

* 1 BINARY FILE

*{THIS PROGRAM HAS 50 FUNCTIONS}

-THIS PROGRAM ALSO NEEDS TEXT FILES AND OTHER FILES INSTALLED IN THE PROPER LOCATION IN THE USERS COMPUTER i.e @ .. C:\BOSS..


[ source code given below , output and other details will be put up soon,........
for further details e-mail........ kdoo7boss@gmail.com ]
SOURCE CODE (GIVEN BELOW ):

#include
#include
#include
#include
#include
#include
int ch;//choice
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
// %% FN DECLARATIONS %%
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void mainmenu();
void menu();
void switchoff();
void disptime();
//==================================menu==============================
void messages();
void contacts();
void callregister();
void settings();
void connection();
void bmclock();
void games();
void reminders();
void extras();
//-------------------------------------messages------------------------
void writemessages();
void inbox();
void sentitems();
void drafts();
void deletemessage();
void messagecounter();
//----------------------------------contacts----------------------------
void searchcontact();
void addnewcontact();
void deletecontact();
void serviceno();
void displaycontact();
void call();
//------------------------------------call register---------------------
void missedcalls();
void receivedcalls();
void dialledno();
void deletecalls();
//--------------------------------settings-------------------------------
void tonesettings();
void profiles();
void timesettings();
void phonesettings();
//_____________________________________connection_________________
void connection();
//__________________________________clock____________________________
void alarmtime();
void alarmtone();
void timesettings();
//____________________________________games___________________________
void games();
//___________________________________reminders________________________
void addnewreminder();
void removereminder();
void editreminder();
void alarmtone();
//---------------------------------extras---------------------------
void calculator();
void converter();
void stopwatch();
//_____________________________________________________________________
//*************************************************************************
// $$ GENERAL FUNCTIONS $$
//*************************************************************************
void switchoff()
{ clrscr();
disptime();
cout<<"\n\n\n\n\t\tBOSS MOBILE TERMINATING...."; getch(); exit(0); } void display_file(char str[]) //gen fn to open a file display its contents { clrscr(); disptime(); ifstream file; file.open(str); if(!file) { cout<<"\n\n\tSORRY, PAGE CANNOT BE DISPLAYED \n\n\t\tBOSS MOBILE SWITCHING OFF....."; getch();exit(0); } char ch; while(file) { file.get(ch); cout<<<"*******************************************************************************"; cout<<"\nTODAY'S DATE:"<<<"\t\t--BOSS-MOBILE--\t\tPRESENT TIME:"<<<"\n\n********************************************************************************"; } //***************************************************************** int getchoice() // gen fn get choice from user { int ch; cin>>ch;
return ch;
}
//******************************************************************
void wrongchoice() //gen fun ask user for valid ch
{
clrscr();
disptime();
cout<<"\n\n\t\t\t PLEASE ENTER A VALID CHOICE.......";//take 2 getch(); } //******************************************************************** void nosim() { clrscr(); disptime(); char str[]="c:/boss/intrface/nosim.txt"; display_file(str); getch(); menu(); } //********************************************************************* //******************************************************************* // $$ MAIN MENU $$ //******************************************************************* void mainmenu() // fun 1 { char str[]="c:/boss/intrface/main.txt"; display_file(str); ch=getchoice(); switch(ch) { case 1:menu(); break; case 0:switchoff(); break; case 2:displaycontact();getch();mainmenu(); break; default:wrongchoice(); mainmenu(); break; } } //******************************************************************* // $$ MENU $$ //******************************************************************* void menu() //fun 2 { char str[]="c:/boss/intrface/menu.txt" ; display_file(str); ch=getchoice(); switch(ch) { case 0:mainmenu(); break; case 1:messages(); break; case 2:contacts(); break; case 3:callregister(); break; case 4:settings(); break; case 9:connection(); break; case 5:bmclock(); break; case 7:games(); break; case 6:reminders(); break; case 8:extras(); break; default:wrongchoice(); menu(); break; } } //###################################################################### // $$ FUNCTIONS IN MENU $$ //####################################################################### //------------------------------------messages--------------------------- void messages() { char str[]="c:/boss/intrface/messages.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:writemessages(); break; case 2:inbox(); break; case 3:sentitems(); break; case 4:drafts(); break; case 5:deletemessage(); break; case 6:messagecounter(); break; default:wrongchoice(); messages(); break; } } //______________________________contacts___________________________________ void contacts() { char str[]="c:/boss/intrface/contacts.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:searchcontact(); break; case 2:addnewcontact(); break; case 3:deletecontact(); break; case 4:serviceno(); break; case 5:displaycontact(); break; case 6:call(); break; default:wrongchoice(); contacts(); break; } getch(); contacts(); } //_______________________call register___________________________________ void callregister() { char str[]="c:/boss/intrface/callreg.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:missedcalls(); break; case 2:receivedcalls(); break; case 3:dialledno(); break; case 4:deletecalls(); break; default:wrongchoice(); callregister(); break; } } //_--------------------------settings------------------------------- void settings() { char str[]="c:/boss/intrface/settings.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:tonesettings(); break; case 2:profiles(); break; case 3:timesettings(); break; case 4:phonesettings(); break; default:wrongchoice(); settings(); break; } } //__________________________connection________________________________ void connection() { nosim(); } //_______________________clock________________________________________ void bmclock() { char str[]="c:/boss/intrface/clock.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:alarmtime(); break; case 2:alarmtone(); break; case 3:timesettings(); break; default:wrongchoice(); bmclock(); break; } } //__________________________games________________________________________ void games() { char str[]="c:/boss/intrface/games.txt"; getch(); display_file(str); menu(); } //___________________________reminders__________________________________ void reminders() { char str[]="c:/boss/intrface/reminder.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:addnewreminder(); break; case 2:removereminder(); break; case 3:editreminder(); break; case 4:alarmtone(); break; default:wrongchoice(); reminders(); } } //-----------------------extras---------------------------------------- void extras() { char str[]="c:/boss/intrface/extras.txt"; display_file(str); ch=getchoice(); switch(ch) { case 0:menu(); break; case 1:calculator(); break; case 2:converter(); break; case 3:stopwatch(); break; default:wrongchoice(); extras(); } } //------------------------------------------------------------------------- //*********************************************************************** // $$ MESSAGES $$ //*********************************************************************** void writemessages()//writemessages { char str[]="c:/boss/intrface/wmsg.txt"; display_file(str); fstream file; cin>>ch;
switch(ch)
{
case 1://1=write message
char name[12],line[80]="null";
char str[40]="c:/boss/messages/";
file.open("c:/boss/messages/temp.txt",ios::out);
if(!file)
{
cout<<"SORRY FOR THE INTERRUPTION ,\n BOSS MOBILE HAS TO TERMINATE DUE TO TECHNICAL REASONS \n PLEASE CONTACT VENDOR...."; getch(); exit(0); } clrscr(); display_title(); cout<<"WRITE THE MESSAGE:\n"; while(strcmpi(line,"ok")!=0) {cin.getline(line,80); file<<<"\n"; } file.close(); cout<<"\n MESSAGE COMPOSED....\n\t\t";
getch();
// display msg work
clrscr();
char str1[]="c:/boss/intrface/wrknmsg.txt";
display_file(str1);
cin>>ch;
clrscr();
display_title();
switch(ch)
{
case 1:char num[20]; //1=send
display_title();
cout<<"\n\nENTER THE RECEIPIENT's PHONE NO:.."; gets(num); char asd[]="c:/boss/intrface/nosim.txt"; display_file(asd); break; case 2:display_title(); cout<<"\n\nENTER A NAME TO SAVE THE MESSAGE"; //2=save to drafts gets(name); strcat(str,name); strcat(str,".txt"); rename("c:/boss/messages/temp.txt",str); file.open("c:/boss/messages/save.txt",ios::out|ios::app); if(!file) { cout<<"SORRY FOR THE INTERRUPTION ,\n\n BOSS MOBILE HAS TO TERMINATE DUE TO TECHNICAL REASONS \n\n PLEASE CONTACT VENDOR...."; getch();exit(0); } else file<<"\n"<<<"\n\nMESSAGE SUCCESGFULLY SAVED TO DRAFTS......"; cout<<"\n\t\tPRESS ANY KEY TO CONT....."; break; case 3://3=exit without saving messages(); break; default:cout<<"wrong choice"; getch(); wrongchoice(); writemessages(); } break; case 2://back to messages messages(); break; default:cout<<"wrong choice"; getch(); wrongchoice(); writemessages(); } } void sentitems() { char asd[]="c:/boss/intrface/no_sim.txt"; display_file(asd); messages(); } void drafts() { //clrscr(); char str[]="c:/boss/messages/save.txt"; char msg[50]="null"; ifstream file; file.open(str); int count=0; cout<<"MESSAGES SAVED TO DRAFTS::\n\n"; if(!file) {cout<<"FILE CANNOT "; getch(); } while(!file.eof()) { file.getline(msg,45); cout<<"\n\t"<<<"->";
puts(msg);
count++;
}
file.close();
file.open(str);count=0;
cout<<"\n\n\tENTER THE MESSAGE NO:{1/2/3..} TO VIEW:::"; int msgno; cin>>msgno;
while(!file.eof())
{
file.getline(msg,50);

if(msgno==count)
{display_title();
cout<<"OPENING MESSAGE FROM ................\n\t\t\t"; puts(msg); break; } count++; } if(msgno!=count) { cout<<"ENTER CORRECT CHOICE"; getch(); void drafts(); } file.close(); file.open(msg); char line[80]; while(file) { file.getline(line,80); cout<<<"\n"; } getch(); cout<<"\n\n\a\a\a\t"; // display msg work clrscr(); char name[12],str1[]="c:/boss/intrface/wrknmsg.txt"; display_file(str1); cin>>ch;
clrscr();
display_title();

switch(ch)
{
case 1:char num[20]; //1=send
display_title();
cout<<"\n\nENTER THE RECEIPIENT's PHONE NO:.."; gets(num); char asd[]="c:/boss/intrface/no_sim.txt"; display_file(asd); break; case 3://3=exit without saving messages(); break; default:cout<<"wrong choice"; getch(); wrongchoice(); messages(); break; getch(); messages(); } } //************************************************************ void deletemessage() { char str[]="c:/boss/messages/save.txt"; char msg[50]="null"; ifstream file; file.open(str); int count=0; display_title(); cout<<"MESSAGES SAVED TO DRAFTS::\n\n"; if(!file) { cout<<"FILE CANNOT "; getch(); } while(!file.eof()) { file.getline(msg,45); cout<<"\n\t"<<<"->";
puts(msg); count++;
}
file.close();
file.open(str);count=0;
cout<<"\n\n\tENTER THE MESSAGE NO:{1/2/3..} TO BE DELETED:::"; int msgno; cin>>msgno;
while(!file.eof())
{
file.getline(msg,50);
if(msgno==count)
{
cout<<"\n\nDELETING MESSAGE FROM ................\n\t\t\t"; puts(msg); getch(); break; } count++; } if(msgno!=count) { cout<<"\nENTER CORRECT CHOICE"; getch(); drafts(); } file.close(); file.open(str); ofstream fout; fout.open("c:/boss/messages/temp.txt"); char line[80]; while(file) { file.getline(line,80); if(strcmpi(line,msg)!=0) { fout<<<"\n"; } } file.close(); fout.close(); remove(msg); rename("c:/boss/messages/temp.txt",msg); cout<<"\nDELETED SUCCESSFULLY"; getch(); drafts(); } void messagecounter() { nosim(); } void inbox() { nosim(); } //********************************************************************* //----------------------------------contacts---------------------------- class contact { char name[20]; char ph[15]; public: void getdata() { cout<<"\nName: \t"; cin>>name;
cout<<"\nPh.no: \t"; cin>>ph;
}
void dispdata()
{
cout<<"\n\n\tNAME:"<<<"..........\t\tPH.NO:"; cout<<<"\nFILE NOT FOUND:;"; getch();} cout<<"\n\n\n\t\tENTER 'CONTACT NAME' TO SEARCH FOR DETAILS::"; gets(nam); while(!fin.eof()) { fin.read((char*)&ob,sizeof(ob)); if(ob.retchcknam(nam)==0) { cout<<"\nDETAILS OF: "<<<"::\n "; ob.dispdata(); found='y'; break; } } if(found=='n') cout<<" \nNAME NOT FOUND"<<<"\n\n\tADD NEW CONTACT"; ob.getdata(); fin.write((char*)&ob,sizeof(ob)); cout<<"\n\tDO YOU WANT TO ENTER MORE ..y/n"; cin>>ch;
fin.close();
if(ch=='y')
addnewcontact();
else
{clrscr();
cout<<"\n\tCONTACT SAVED...."; ob.dispdata(); cout<<"\n \tOPENING CONTACTS..\n"; displaycontact(); } } void deletecontact() { contact ob; clrscr();display_title();disptime(); displaycontact(); fstream fin; fin.open("c:/boss/phmem/contact.dat",ios::in); fstream fout; fout.open("c:/boss/phmem/temp.dat",ios::out); char found='n'; cout<<"\n\n\nENTER THE CONTACT NAME TO BE DELETED FROM THE LIST:"; char nam[21]=" "; gets(nam); while(!fin.eof()) { fin.read((char*)&ob,sizeof(ob)); if(ob.retchcknam(nam)==0) { found='y'; } else if(!fin.eof()) fout.write((char*)&ob,sizeof(ob)); } if(found=='n') cout<<"\nCONTACT NOT FOUND OR UNABLE TO DELETED"; fout.close(); fin.close(); remove("c:/boss/phmem/contact.dat"); rename("c:/boss/phmem/temp.dat","c:/boss/phmem/contact.dat"); fin.open("c:/boss/phmem/contact.dat",ios::in); cout<<"\n\nUPDATED CONTACTS"; while(!fin.eof()) { fin.read((char*)&ob,sizeof(ob)); if(fin.eof()) break; ob.dispdata(); } fin.close(); } void serviceno() {nosim(); } void displaycontact() { clrscr(); display_title();disptime(); contact ob; fstream fin; fin.open("c:/boss/phmem/contact.dat",ios::in|ios::binary); if(!fin) { cout<<"file can't be opened"; getch(); exit(0); } cout<<"\n\t\t CONTACTS.."; while(fin) { fin.read((char*)&ob,sizeof(ob)); if(fin.eof()) break; ob.dispdata(); } fin.close(); } void call() {char num[20]=" "; display_title();disptime(); cout<<"\n\nENTER THE RECEIPIENT's PHONE NO:.."; gets(num); nosim(); contacts(); } //************************************************************ //------------------------------------call register--------------------- //********************************************************************* void missedcalls() { nosim(); } void receivedcalls() { nosim(); } void dialledno() { nosim(); } void deletecalls() { nosim(); } //******************************************************************** //--------------------------------settings------------------------------- //********************************************************************** void tonesettings() { nosim(); } void profiles() { nosim(); } void timesettings() { char time[9],date[9]; clrscr(); _strdate(date); _strtime(time); cout<<"********************************************************************************"; cout<<"\nTODAY'S DATE:"<<<"\t\t--BOSS-MOBILE--\t\tPRESENT TIME:"<<<"\n\n********************************************************************************"; getch(); menu(); } void phonesettings() { nosim(); } //****************************************************************** //__________________________________clock____________________________ //****************************************************************** void alarmtime() { nosim(); } void alarmtone() { nosim(); } //******************************************************************** //___________________________________reminders________________________ //********************************************************************* void addnewreminder() { nosim(); } void removereminder() { nosim(); } void editreminder() { nosim(); } //******************************************************************* //---------------------------------extras--------------------------- //****************************************************************** void calculator() //calculator { int choice; // clrscr(); //char str[]=" float oprnd1,oprnd2,result; do { cout<<"\nENTER THE FIRST OPERAND:"; cin>>oprnd1;
cout<<"\n ENTER OPERATOR CHOICE {FROM DETAILS GIVEN ABOVE}: "; cin>>ch;
cout<<"\n ENTER THE SECOND OPERAND:"; cin>>oprnd2;
switch(ch)
{
case 1://addn
result=oprnd1+oprnd2;
cout<<"RESULT:="<<<"RESULT:="<<<"RESULT:="<<<"RESULT:="<<<"ENTER THE CORRECT CHOICE:" ; calculator(); } cout<<"\n\n\tDO YOU WANT BOSS TO CALCULATE MORE......\n yes=1.\n no=2"<<"\n ENTER YOUR CHOICE...(1/2)"; cin>>choice;
}while(choice==1);
menu();
}


void converter()
{
nosim();
}

void stopwatch()
{
nosim();
}
//_____________________________________________________________________
//**************************************************************************

void main()
{
clrscr();
char str[]="c:/boss/intrface/login.txt";
display_file(str);

char passwrd[15]=" ";
//read password
int i=0;char ch;

while(ch!=13)
{
ch=getch();
if(ch!=13)
{cout<<"*"; passwrd[i]=ch; i++; } } char boss[]="boss"; if(strcmpi(boss,passwrd)==0) {cout<<"\n\tPASSWORD VERIFIED \n\n\n\t\t BOSS MOBILE LOGGING ON"; getch(); char str1[]="c:/boss/intrface/welcome.txt"; display_file(str1); getch(); } else {cout<<"PASSWORD INCORRECT"; cout<<"\n\t TERMINATING"; getch(); switchoff(); } mainmenu(); }

1 comment: