Popular Posts

Showing posts with label Developer. Show all posts
Showing posts with label Developer. Show all posts

1/30/2013

10 reasons why PCs crash U must Know


Hey Guy Today I'm gona show you about the following step that you have to know.

Fatal error : the system has become unstable or is busy," it says. "Enter to return to Windows or press Control-Alt-Delete to restart your computer. If you do this you will lose any unsaved information in all open applications."

You have just been struck by the Blue Screen of Death. Anyone who uses Mcft Windows will be familiar with this. What can you do? More importantly, how can you prevent it happening?

1 Hardware conflict

The number one reason why Windows crashes is hardware conflict. Each hardware device communicates to other devices through an interrupt request channel (IRQ). These are supposed to be unique for each device.

For example, a printer usually connects internally on IRQ 7. The keyboard usually uses IRQ 1 and the floppy disk drive IRQ 6. Each device will try to hog a single IRQ for itself.

If there are a lot of devices, or if they are not installed properly, two of them may end up sharing the same IRQ number. When the user tries to use both devices at the same time, a crash can happen. The way to check if your computer has a hardware conflict is through the following route:

* Start-Settings-Control Panel-System-Device Manager.

Often if a device has a problem a yellow '!' appears next to its description in the Device Manager. Highlight Computer (in the Device Manager) and press Properties to see the IRQ numbers used by your computer. If the IRQ number appears twice, two devices may be using it.

Sometimes a device might share an IRQ with something described as 'IRQ holder for PCI steering'. This can be ignored. The best way to fix this problem is to remove the problem device and reinstall it.

Sometimes you may have to find more recent drivers on the internet to make the device function properly. A good resource is www.driverguide.com. If the device is a soundcard, or a modem, it can often be fixed by moving it to a different slot on the motherboard (be careful about opening your computer, as you may void the warranty).

When working inside a computer you should switch it off, unplug the mains lead and touch an unpainted metal surface to discharge any static electricity.

To be fair to Mcft, the problem with IRQ numbers is not of its making. It is a legacy problem going back to the first PC designs using the IBM 8086 chip. Initially there were only eight IRQs. Today there are 16 IRQs in a PC. It is easy to run out of them. There are plans to increase the number of IRQs in future designs.

2 Bad Ram

Ram (random-access memory) problems might bring on the blue screen of death with a message saying Fatal Exception Error. A fatal error indicates a serious hardware problem. Sometimes it may mean a part is damaged and will need replacing.

But a fatal error caused by Ram might be caused by a mismatch of chips. For example, mixing 70-nanosecond (70ns) Ram with 60ns Ram will usually force the computer to run all the Ram at the slower speed. This will often crash the machine if the Ram is overworked.

One way around this problem is to enter the BIOS settings and increase the wait state of the Ram. This can make it more stable. Another way to troubleshoot a suspected Ram problem is to rearrange the Ram chips on the motherboard, or take some of them out. Then try to repeat the circumstances that caused the crash. When handling Ram try not to touch the gold connections, as they can be easily damaged.

Parity error messages also refer to Ram. Modern Ram chips are either parity (ECC) or non parity (non-ECC). It is best not to mix the two types, as this can be a cause of trouble.

EMM386 error messages refer to memory problems but may not be connected to bad Ram. This may be due to free memory problems often linked to old Dos-based programmes.

3 BIOS settings

Every motherboard is supplied with a range of chipset settings that are decided in the factory. A common way to access these settings is to press the F2 or delete button during the first few seconds of a boot-up.

Once inside the BIOS, great care should be taken. It is a good idea to write down on a piece of paper all the settings that appear on the screen. That way, if you change something and the computer becomes more unstable, you will know what settings to revert to.

A common BIOS error concerns the CAS latency. This refers to the Ram. Older EDO (extended data out) Ram has a CAS latency of 3. Newer SDRam has a CAS latency of 2. Setting the wrong figure can cause the Ram to lock up and freeze the computer's display.

Mcft Windows is better at allocating IRQ numbers than any BIOS. If possible set the IRQ numbers to Auto in the BIOS. This will allow Windows to allocate the IRQ numbers (make sure the BIOS setting for Plug and Play OS is switched to 'yes' to allow Windows to do this.).

4 Hard disk drives

After a few weeks, the information on a hard disk drive starts to become piecemeal or fragmented. It is a good idea to defragment the hard disk every week or so, to prevent the disk from causing a screen freeze. Go to

* Start-Programs-Accessories-System Tools-Disk Defragmenter

This will start the procedure. You will be unable to write data to the hard drive (to save it) while the disk is defragmenting, so it is a good idea to schedule the procedure for a period of inactivity using the Task Scheduler.

The Task Scheduler should be one of the small icons on the bottom right of the Windows opening page (the desktop).

Some lockups and screen freezes caused by hard disk problems can be solved by reducing the read-ahead optimisation. This can be adjusted by going to

* Start-Settings-Control Panel-System Icon-Performance-File System-Hard Disk.

Hard disks will slow down and crash if they are too full. Do some housekeeping on your hard drive every few months and free some space on it. Open the Windows folder on the C drive and find the Temporary Internet Files folder. Deleting the contents (not the folder) can free a lot of space.

Empty the Recycle Bin every week to free more space. Hard disk drives should be scanned every week for errors or bad sectors. Go to

* Start-Programs-Accessories-System Tools-ScanDisk

Otherwise assign the Task Scheduler to perform this operation at night when the computer is not in use.

5 Fatal OE exceptions and VXD errors

Fatal OE exception errors and VXD errors are often caused by video card problems.

These can often be resolved easily by reducing the resolution of the video display. Go to

* Start-Settings-Control Panel-Display-Settings

Here you should slide the screen area bar to the left. Take a look at the colour settings on the left of that window. For most desktops, high colour 16-bit depth is adequate.

If the screen freezes or you experience system lockups it might be due to the video card. Make sure it does not have a hardware conflict. Go to

* Start-Settings-Control Panel-System-Device Manager

Here, select the + beside Display Adapter. A line of text describing your video card should appear. Select it (make it blue) and press properties. Then select Resources and select each line in the window. Look for a message that says No Conflicts.

If you have video card hardware conflict, you will see it here. Be careful at this point and make a note of everything you do in case you make things worse.

The way to resolve a hardware conflict is to uncheck the Use Automatic Settings box and hit the Change Settings button. You are searching for a setting that will display a No Conflicts message.

Another useful way to resolve video problems is to go to

* Start-Settings-Control Panel-System-Performance-Graphics

Here you should move the Hardware Acceleration slider to the left. As ever, the most common cause of problems relating to graphics cards is old or faulty drivers (a driver is a small piece of software used by a computer to communicate with a device).

Look up your video card's manufacturer on the internet and search for the most recent drivers for it.

6 Viruses

Often the first sign of a virus infection is instability. Some viruses erase the boot sector of a hard drive, making it impossible to start. This is why it is a good idea to create a Windows start-up disk. Go to

* Start-Settings-Control Panel-Add/Remove Programs

Here, look for the Start Up Disk tab. Virus protection requires constant vigilance.

A virus scanner requires a list of virus signatures in order to be able to identify viruses. These signatures are stored in a DAT file. DAT files should be updated weekly from the website of your antivirus software manufacturer.

An excellent antivirus programme is McAfee VirusScan by Network Associates ( www.nai.com). Another is Norton AntiVirus 2000, made by Symantec ( www.symantec.com).

7 Printers

The action of sending a document to print creates a bigger file, often called a postscript file.

Printers have only a small amount of memory, called a buffer. This can be easily overloaded. Printing a document also uses a considerable amount of CPU power. This will also slow down the computer's performance.

If the printer is trying to print unusual characters, these might not be recognised, and can crash the computer. Sometimes printers will not recover from a crash because of confusion in the buffer. A good way to clear the buffer is to unplug the printer for ten seconds. Booting up from a powerless state, also called a cold boot, will restore the printer's default settings and you may be able to carry on.

8 Software

A common cause of computer crash is faulty or badly-installed software. Often the problem can be cured by uninstalling the software and then reinstalling it. Use Norton Uninstall or Uninstall Shield to remove an application from your system properly. This will also remove references to the programme in the System Registry and leaves the way clear for a completely fresh copy.

The System Registry can be corrupted by old references to obsolete software that you thought was uninstalled. Use Reg Cleaner by Jouni Vuorio to clean up the System Registry and remove obsolete entries. It works on Windows 95, Windows 98, Windows 98 SE (Second Edition), Windows Millennium Edition (ME), NT4 and Windows 2000.

Read the instructions and use it carefully so you don't do permanent damage to the Registry. If the Registry is damaged you will have to reinstall your operating system. Reg Cleaner can be obtained from www.jv16.org

Often a Windows problem can be resolved by entering Safe Mode. This can be done during start-up. When you see the message "Starting Windows" press F4. This should take you into Safe Mode.

Safe Mode loads a minimum of drivers. It allows you to find and fix problems that prevent Windows from loading properly.

Sometimes installing Windows is difficult because of unsuitable BIOS settings. If you keep getting SUWIN error messages (Windows setup) during the Windows installation, then try entering the BIOS and disabling the CPU internal cache. Try to disable the Level 2 (L2) cache if that doesn't work.

Remember to restore all the BIOS settings back to their former settings following installation.

9 Overheating

Central processing units (CPUs) are usually equipped with fans to keep them cool. If the fan fails or if the CPU gets old it may start to overheat and generate a particular kind of error called a kernel error. This is a common problem in chips that have been overclocked to operate at higher speeds than they are supposed to.

One remedy is to get a bigger better fan and install it on top of the CPU. Specialist cooling fans/heatsinks are available from www.computernerd.com or www.coolit.com

CPU problems can often be fixed by disabling the CPU internal cache in the BIOS. This will make the machine run more slowly, but it should also be more stable.

10 Power supply problems

With all the new construction going on around the country the steady supply of electricity has become disrupted. A power surge or spike can crash a computer as easily as a power cut.

If this has become a nuisance for you then consider buying a uninterrupted power supply (UPS). This will give you a clean power supply when there is electricity, and it will give you a few minutes to perform a controlled shutdown in case of a power cut.

It is a good investment if your data are critical, because a power cut will cause any unsaved data to be lost.

6/26/2012

The best trick to search in google .

Google is the biggest search engine in the world. It's store Billion of documents and more. Sometime you spend more time to search on Google but you don't get what you want from it. 
So today I'll show you the best trick to search from Google like pdf file, exe file, and many other up to what you want. 
Let follow my step: 
  • Goto  Google.com
  • In google search box type : intitle:index.of?.Extension FileName
         Extension : The extension of file that you want to search (Ex: .exe, .pdf, .doc ....)
         FileName : Filename that you want to search (Ex: Maketing Plan, HTML Lesson ...)



Than hit Enter ..




Click on any URL that you want 




It will show list of file that you want and download it easily ..! 
If you think this post is useful leave a command and share it to your friends ..!









































6/25/2012

12 Expert Google Search Tips


If you’re like me, you probably use Google many times a day.  But, chances are, unless you are a technology geek, you probably still use Google in its simplest form.  If your current use of Google is limited to typing a few words in, and changing your query until you find what you’re looking for, then I’m here to tell you that there’s a better way – and it’s not hard to learn.  On the other hand, if you are a technology geek, and can use Google like the best of them already, then I suggest you bookmark this article of Google search tips.  You’ll then have the tips on hand when you are ready to pull your hair out in frustration when watching a neophyte repeatedly type in basic queries in a desperate attempt to find something.
The following Google search tips are based on my own experience and things that I actually find useful.  The list is by no means comprehensive.  But, I assure you that by learning and using the 12 tips below, you’ll rank up there with the best of the Google experts out there.  I’ve kept the descriptions of the search tips intentionally terse as you’re likely to grasp most of these simply by looking at the example from Google anyways.



  • Explicit Phrase:
    Lets say you are looking for content about internet marketing.  Instead of just typing internet marketing into the Google search box, you will likely be better off searching explicitly for the phrase.  To do this, simply enclose the search phrase within double quotes.
    Example: "internet marketing"
  • Exclude Words:
    Lets say you want to search for content about internet marketing, but you want to exclude any results that contain the term advertising.  To do this, simply use the "-" sign in front of the word you want to exclude.
    Example Search: internet marketing -advertising
  • Site Specific Search:
    Often, you want to search a specific website for content that matches a certain phrase.  Even if the site doesn’t support a built-in search feature, you can use Google to search the site for your term. Simply use the "site:somesite.com" modifier.
    Example: "internet marketing" site:www.smallbusinesshub.com
  • Similar Words and Synonyms:
    Let’s say you want to include a word in your search, but want to include results that contain similar words or synonyms.  To do this, use the "~" in front of the word.
    Example: "internet marketing" ~professional
  • Specific Document Types:
    If you’re looking to find results that are of a specific type, you can use the modifier "filetype:".  For example, you might want to find only PowerPoint presentations related to internet marketing.
    Example: "internet marketing" filetype:ppt
  • This OR That:
    By default, when you do a search, Google will include all the terms specified in the search.  If you are looking for any one of one or more terms to match, then you can use the OR operator.  (Note: The OR has to be capitalized).
    Example: internet marketing OR advertising
  • Phone Listing:
    Let’s say someone calls you on your mobile number and you don’t know who it is.  If all you have is a phone number, you can look it up on Google using the phonebook feature.
    Example: phonebook:617-555-1212 (note: the provided number does not work – you’ll have to use a real number to get any results).
  • Area Code Lookup:
    If all you need to do is to look-up the area code for a phone number, just enter the 3-digit area code and Google will tell you where it’s from.
    Example: 617
  • Numeric Ranges:
    This is a rarely used, but highly useful tip.  Let’s say you want to find results that contain any of a range of numbers.  You can do this by using the X..Y modifier (in case this is hard to read, what’s between the X and Y are two periods.)  This type of search is useful for years (as shown below), prices, or anywhere where you want to provide a series of numbers.
    Example: president 1940..1950
  • Stock (Ticker Symbol):
    Just enter a valid ticker symbol as your search term and Google will give you the current financials and a quick thumb-nail chart for the stock.
    Example: GOOG
  • Calculator:
    The next time you need to do a quick calculation, instead of bringing up the Calculator applet, you can just type your expression in to Google.
    Example: 48512 * 1.02
  • Word Definitions:
    If you need to quickly look up the definition of a word or phrase, simply use the "define:" command.
    Example: define:plethora
  • Read more: http://blog.hubspot.com/blog/tabid/6307/bid/1264/12-Quick-Tips-To-Search-Google-Like-An-Expert.aspx#ixzz1yozVCDD4

    If you think this post is useful don't forget share it to your friend and hit like ..!

    School Management System In C Programming


    Welcome to School Management system Using C Programming
    Download Here
    And the following code :
    ===========================================
    #include<stdio.h>
    #include<conio.h>
    #include<string.h>
    #include<dos.h>
    struct student{
    char id[10];
    char name[20];
    char sex;
    int math,eng,khmer;
    float avg;
    char grade[10];
    char DOB[20];
    };
    char getG(int score){

         if(score<50)
    return 'F';
         else if(score<65)
    return 'E';
         else if(score<75)
    return 'D';
          else if(score<85)
    return 'C';
          else if(score<95)
    return 'B';
          else if(score<=100)
    return 'A';
          else
    return 'G';

    }
    void note(){
    gotoxy(1,31);
    textcolor(RED);
    cprintf("Note:");
    gotoxy(1,32);
    printf("ÍÍÍÍ");

    gotoxy(1,33);
    textcolor(WHITE);
    cprintf("'A' :Score<=100");
    gotoxy(1,34);
    cprintf("'B' :Score<95");
    gotoxy(1,35);
    cprintf("'C' :Score<85");
    gotoxy(1,36);
    cprintf("'D' :Score<75");
    gotoxy(1,37);
    cprintf("'E' :Score<65");
    gotoxy(1,38);
    cprintf("'F' :Score<50");
    gotoxy(1,39);
    cprintf("'G' :'No Grade'");
    gotoxy(55,40);
    textcolor(RED);
    cprintf("Press 'Esc' to exit !!!"); }
    void main(){
    student stu[100],k;
    int i,j=0,n=0,d,m;
    char x[20],ch,st;
    _setcursortype(_NOCURSOR);
    do{
    clrscr();
    gotoxy(1,2);
    textcolor(WHITE);
    cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»");
    gotoxy(1,3);
    cprintf("º Group 5                             º");
    gotoxy(1,4);
    cprintf("º ßßßßßßß                             º");
    gotoxy(1,5);
    cprintf("º Topic : Control Student Information º");
    gotoxy(1,6);
    cprintf("º ßßßßß                               º");
    gotoxy(1,7);
    cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");
    gotoxy(20,15);
    textcolor(YELLOW);
    cprintf("Menu for Control All Student Information:");
    gotoxy(20,16);
    textcolor(RED);
    cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ");
    gotoxy(20,18);
    textcolor(WHITE);
    cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»");
    gotoxy(20,19);
    cprintf("º                                       º");
    gotoxy(20,20);
    cprintf("º 1/ Input Student information          º");
    gotoxy(20,21);
    cprintf("º                                       º");
    gotoxy(20,22);
    cprintf("º 2/ Show Student information           º");
    gotoxy(20,23);
    cprintf("º                                       º");
    gotoxy(20,24);
    cprintf("º 3/ Show Transribe Student information º");
    gotoxy(20,25);
    cprintf("º                                       º");
    gotoxy(20,26);
    cprintf("º 4/ Delete Student information         º");
    gotoxy(20,27);
    cprintf("º                                       º");
    gotoxy(20,28);
    cprintf("º 5/ Edit Student information           º");
    gotoxy(20,29);
    cprintf("º                                       º");
    gotoxy(20,30);
    cprintf("º 6/ Exit Program                       º");
    gotoxy(20,31);
    cprintf("º                                       º");
    gotoxy(20,32);
    cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ");
    gotoxy(1,40);
    textcolor(RED);
    cprintf("Press Number(1-6) for Select Menu !!!");
    ch=getch();
    clrscr();
    switch(ch){
    case '1':
    gotoxy(3,3);
    textcolor(WHITE);
    cprintf("Input number of Student= ");scanf("%d",&m);
     for(i=n;i<n+m;i++){
    clrscr();
    gotoxy(3,3);
    textcolor(WHITE);
    cprintf("Input Id= ");fflush(stdin);gets(stu[i].id);
    gotoxy(3,4);
    cprintf("Input Student Name= ");fflush(stdin);gets(stu[i].name);
    gotoxy(3,5);
    cprintf("Input Date of Birth= ");fflush(stdin);gets(stu[i].DOB);
    gotoxy(3,6);
    cprintf("Input Sex= ");scanf("%c",&stu[i].sex);
    gotoxy(3,7);
    cprintf("Input Math Score= ");scanf("%d",&stu[i].math);
    gotoxy(3,8);
    cprintf("Input English Score= ");scanf("%d",&stu[i].eng);
    gotoxy(3,9);
    cprintf("Input Khmer Score= ");scanf("%d",&stu[i].khmer);
    stu[i].avg=(stu[i].math+stu[i].eng+stu[i].khmer)/3.0;
    stu[i].grade[0]=getG(stu[i].math);
    stu[i].grade[1]=getG(stu[i].khmer);
    stu[i].grade[2]=getG(stu[i].eng);
    stu[i].grade[3]=getG(stu[i].avg);
    clrscr();
    }n=n+m;
    break;
    case '2':
    gotoxy(27,1);
    textcolor(YELLOW);
    cprintf("Show Student Information");
    gotoxy(27,2);
    textcolor(RED);
    cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ");
    gotoxy(1,4);
    textcolor(WHITE);
    cprintf("ÉÍÍÍÍËÍÍÍÍÍÍÍËÍÍÍËÍÍÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍ»");
    gotoxy(1,5);
    cprintf("º ID º  Name ºSexº   DOB  º Math º Grad º Kh º Grad º Eng º Grad º  Avg º Totalº");
    gotoxy(1,6);
    cprintf("ÌÍÍÍÍÎÍÍÍÍÍÍÍÎÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍ͹");
    for(i=0;i<n;i++) {
    gotoxy(1,7+(i*2)-1);
    cprintf("ÌÍÍÍÍÎÍÍÍÍÍÍÍÎÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍ͹");
    gotoxy(1,7+(i*2));
    cprintf("º%4sº%7sº%3cº%8sº%6dº%6cº%4dº%6cº%5dº%6cº%6.2fº%6cº",stu[i].id,stu[i].name,stu[i].sex,stu[i].DOB,stu[i].math,stu[i].grade[0],stu[i].khmer,stu[i].grade[1],stu[i].eng,stu[i].grade[2],stu[i].avg,stu[i].grade[3]);
    gotoxy(1,8+(i*2));
    cprintf("ÈÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍͼ");
    }
    note();
    getch();break;
    case '3':
    clrscr();
    gotoxy(3,3);
    textcolor(WHITE);
    cprintf("Please Input Student Name to Show= ");fflush(stdin);gets(x);
    d=0;
    clrscr();
    gotoxy(27,1);
    textcolor(YELLOW);
    cprintf("Show Transcribe Student Information");
    gotoxy(27,2);
    textcolor(RED);
    cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ\n\n");
    gotoxy(1,4);
    textcolor(WHITE);
    cprintf("ÉÍÍÍÍËÍÍÍÍÍÍÍËÍÍÍËÍÍÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍËÍÍÍÍÍÍ»");
    gotoxy(1,5);
    cprintf("º ID º  Name ºSexº   DOB  º Math º Grad º Kh º Grad º Eng º Grad º  Avg º Totalº");
    gotoxy(1,6);
    cprintf("ÌÍÍÍÍÎÍÍÍÍÍÍÍÎÍÍÍÎÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍÍÎÍÍÍÍÍ͹");
    gotoxy(1,7);
    for(i=0;i<n;i++){
    if(strcmp(stu[i].name,x)==0){
    d=1;
    textcolor(WHITE);
    cprintf("º%4sº%7sº%3cº%8sº%6dº%6cº%4dº%6cº%5dº%6cº%6.2fº%6cº",stu[i].id,stu[i].name,stu[i].sex,stu[i].DOB,stu[i].math,stu[i].grade[0],stu[i].khmer,stu[i].grade[1],stu[i].eng,stu[i].grade[2],stu[i].avg,stu[i].grade[3]);
    cprintf("ÈÍÍÍÍÊÍÍÍÍÍÍÍÊÍÍÍÊÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍÍÊÍÍÍÍÍͼ");
    }
    }
    note();
    if(d==0){
    clrscr();
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Student Name not found");
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press 'Esc' to exit !!!");}
    getch();break;
    case '4':
    do{ clrscr();
    gotoxy(4,1);
    textcolor(YELLOW);
    cprintf("Please select your choice to Delete:");
    gotoxy(4,2);
    textcolor(WHITE);
    cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ");
    gotoxy(2,4);
    cprintf("1/ Search by ID to Delete");
    gotoxy(2,6);
    cprintf("2/ Search by Name to Delete");
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press Number(1 or 2) to Select Menu and 'Esc' to Exit !!!");
    st=getch();
    clrscr();
    switch(st){
    case'1':
    clrscr();
    gotoxy(4,1);
    textcolor(WHITE);
    cprintf("Please Input Id to Delete= ");fflush(stdin);gets(x);
    j=0;
    clrscr();
    for(i=0;i<n;i++){
    if(strcmp(stu[i].id,x)==0|| j==1)
    { j=1;
    stu[i]=stu[i+1];
    }
    clrscr();
    }
    if(j==0){
    gotoxy(2,2);
    printf("Student ID not found");}
    else{
    gotoxy(2,2);
    printf("Delete completed");n=n-1;
    }
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press 'Esc' to exit !!!");
    getch();break;
    case'2':
    clrscr();
    gotoxy(4,1);
    textcolor(WHITE);
    cprintf("Please Input Name to Delete= ");fflush(stdin);gets(x);
    j=0;
    clrscr();
    for(i=0;i<n;i++){
    if(strcmp(stu[i].name,x)==0|| j==1)
    { j=1;
    stu[i]=stu[i+1];
    }
    clrscr();
    }
    if(j==0){
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Student Name not found");}
    else{
    gotoxy(2,2);
    textcolor(WHITE);
    printf("Delete completed");
    n=n-1;
    }
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press 'Esc' to exit !!!");
    getch();break;
      }
         }while(st!=27);     break;
    case '5':
    do{    clrscr();
    gotoxy(4,1);
    textcolor(YELLOW);
    cprintf("Please select your choice to Edit:");
    gotoxy(4,2);
    textcolor(WHITE);
    cprintf("ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ");
    gotoxy(2,4);
    cprintf("1/ Search by ID to Edit");
    gotoxy(2,6);
    cprintf("2/ Search by Name to Edit");
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press Number(1 or 2) to Select Menu and 'Esc' to Exit !!!");
    st=getch();
    clrscr();
    switch(st){
    case'1':
    j=0;
    gotoxy(4,1);
    textcolor(WHITE);
    cprintf("Please Input ID to Edit= ");fflush(stdin);gets(x);
    for(i=0;i<n;i++){
    if(strcmp(stu[i].id,x)==0){ j=1;
    clrscr();
    printf("Input Student Name= ");fflush(stdin);gets(stu[i].name);
    printf("Input Sex= ");scanf("%c",&stu[i].sex);
    printf("Input Date of Birth= ");fflush(stdin);gets(stu[i].DOB);
    printf("Input Math Score= ");scanf("%d",&stu[i].math);
    printf("Input English Score= ");scanf("%d",&stu[i].eng);
    printf("Input Khmer Score= ");scanf("%d",&stu[i].khmer);
         stu[i].avg=(stu[i].math+stu[i].eng+stu[i].khmer)/3.0;
    stu[i].grade[0]=getG(stu[i].math);
    stu[i].grade[1]=getG(stu[i].khmer);
    stu[i].grade[2]=getG(stu[i].eng);
    stu[i].grade[3]=getG(stu[i].avg);
    }
    }
    clrscr();
    if(j==0){
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Student ID not found");}
    else{
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Edit update completed");}
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press 'Esc' exit !!!");
    getch();break;
    case'2':
    j=0;
    gotoxy(4,1);
    textcolor(WHITE);
    cprintf("Please Input Name to Edit= ");fflush(stdin);gets(x);
    for(i=0;i<n;i++){
    if(strcmp(stu[i].name,x)==0){ j=1;
    clrscr();
    printf("Input Student ID= ");fflush(stdin);gets(stu[i].id);
    printf("Input Sex= ");scanf("%c",&stu[i].sex);
    printf("Input Date of Birth= ");fflush(stdin);gets(stu[i].DOB);
    printf("Input Math Score= ");scanf("%d",&stu[i].math);
    printf("Input English Score= ");scanf("%d",&stu[i].eng);
    printf("Input Khmer Score= ");scanf("%d",&stu[i].khmer);
         stu[i].avg=(stu[i].math+stu[i].eng+stu[i].khmer)/3.0;
    stu[i].grade[0]=getG(stu[i].math);
    stu[i].grade[1]=getG(stu[i].khmer);
    stu[i].grade[2]=getG(stu[i].eng);
    stu[i].grade[3]=getG(stu[i].avg);
    }
    }
    clrscr();
    if(j==0) {
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Student Name not found");}
    else{
    gotoxy(2,2);
    textcolor(WHITE);
    cprintf("Edit update completed");
    }
    gotoxy(2,40);
    textcolor(RED);
    cprintf("Press 'Esc' to exit !!!");
    getch();break;     }
      }while(st!=27);   break;
    }
    }while(ch!=27 && ch!='6');
    }

    Hotel Management in C Programming

    Welcome to Home Land Hotel
    Download Here 
    and the following code :
    =======================================

    #include<stdio.h>
    #include<conio.h>
    #include<stdlib.h>
    #include<string.h>
    typedef struct {int day;
    int month;
    int year;
    }date;
    struct customer{int id;
    char name[20];
    date da_in;
    date da_out;
    int n_of_room;
    char room;
    int price;
    }cust[30],temp;
    int n,i,j,ID=0; int d,p,e; char a,b,c; int room;
    void check_in();
    void check_out();
    void edit();
    void view();
    void search();
    void draw();
    void main()
    {
    char ch;
    while(1)
    {clrscr();
     textcolor(6); gotoxy(30,2); cprintf("Welcome to Home Land Hotel");textcolor(7);cprintf("");
     gotoxy(35,5); printf("Main Menu");
     gotoxy(3,9); printf("Please Press Any Keys Below");
     gotoxy(8,12); printf("1/ Check In the Customer");
     gotoxy(8,14); printf("2/ Check Out the Customer");
     gotoxy(8,16); printf("3/ Edit the Customer");
     gotoxy(8,18); printf("4/ View List of Customer");
     gotoxy(8,20); printf("5/ Search the Customer");
     gotoxy(8,22); printf("6/ Exit The Program");
     ch=getch();
     switch(ch)
     {case'1':clrscr(); check_in(); break;
      case'2':clrscr(); check_out(); break;
      case'3':clrscr(); edit(); break;
      case'4':clrscr(); view(); break;
      case'5':clrscr(); search(); break;
      case'6':clrscr(); exit(1);  break;
      default:gotoxy(3,27); printf("Error Enter Again!!");getch(); break;
     }
     }
    }


    //********The Function of Program  Check in********
    void check_in()
    {
    draw();
    gotoxy(30,3); printf("Customer %04d",ID+1);
    gotoxy(10,6); printf("Name="); fflush(stdin); gets(cust[ID].name);
    gotoxy(10,8); printf("Input Date Check In="); scanf("%d%c%d%c%d",&cust[ID].da_in.day,&a,&cust[ID].da_in.month,&b,&cust[ID].da_in.year);
    again:
    gotoxy(10,10); printf("                                       ");
    gotoxy(10,10);printf("Room Number="); scanf("%d",&cust[ID].n_of_room);
    if( cust[ID].n_of_room<101 || cust[ID].n_of_room>109 && cust[ID].n_of_room<201 || cust[ID].n_of_room>209 && cust[ID].n_of_room<301 || cust[ID].n_of_room>309)
       { gotoxy(10,10); printf("NO that Room!!!");
    getch(); goto again;}
    for(i=0;i<ID;i++)
    {if(cust[i].n_of_room==cust[ID].n_of_room)
    {gotoxy(10,10); printf("Room Number %d Aready Exist",cust[ID].n_of_room);
    getch(); goto again;
    }
    }
    again1:
    gotoxy(10,12); printf("                                       ");
    gotoxy(10,12); printf("Type of Room="); fflush(stdin); scanf("%c",&cust[ID].room);
    if(cust[ID].room!='D' && cust[ID].room!='d' && cust[ID].room!='S' && cust[ID].room!='s')
    {gotoxy(10,12); printf("Error type of room must be D or S ");getch();
    goto again1;}

    cust[ID].id=ID+1;
    if(cust[ID].room=='D' || cust[ID].room=='d')
    cust[ID].price=20;
    if(cust[ID].room=='S' || cust[ID].room=='s')
    {cust[ID].price=15;}
    cust[ID].da_out.day=0;
    cust[ID].da_out.month=0;
    cust[ID].da_out.year=0;
    ID++;
    }
    //******The Function of Program Check out********
    void check_out()
    {
    char ch;
    gotoxy(10,3); printf ("For Check_out!!! Input Customer ID=");
    scanf("%d",&n);
    gotoxy(10,6); printf("customer Name=%s  Y/N?",cust[n-1].name);ch=getch(); if (ch=='n' || ch== 'N') goto exit;
    gotoxy(10,8);  printf("Date Check in=%02d/%02d/%02d",cust[n-1].da_in.day,cust[n-1].da_in.month,cust[n-1].da_in.year);
    gotoxy(10,10); printf("Input Date Check Out="); scanf("%d%c%d%c%d",&cust[n-1].da_out.day,&a,&cust[n-1].da_out.month,&b,&cust[n-1].da_out.year);
    gotoxy(10,12); printf("Room Type = '%c' so the price per night= %02d.00$",cust[n-1].room,cust[n-1].price);
    gotoxy(30,18); printf("Thank You");
    d=cust[n-1].da_out.day-cust[n-1].da_in.day;
    p=d*cust[n-1].price;
    gotoxy(25,20); printf("You have Stay for %d days",d);
    gotoxy(30,22); printf("Cost=%d.00$",p); getch();
    cust[n-1].room=NULL;
    cust[n-1].n_of_room=NULL;
    cust[n-1].price=NULL;
    exit:

    }
    //******The Function of Program View********
    void view()
    {
    clrscr();
    gotoxy(30,3); printf("List of Customer");
    gotoxy(1,7); printf("ID");
    gotoxy(8,7); printf("Name");
    gotoxy(24,7); printf("Check_in");
    gotoxy(39,7); printf("Check_out");
    gotoxy(54,7); printf("NO_of_Room");
    gotoxy(67,7); printf("room");
    gotoxy(74,7); printf("Price");
    gotoxy(1,9); printf("==============================================================================");
    for(i=0;i<ID;i++)
    {
    gotoxy(1,11+(i*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(i*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(i*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(i*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(i*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(i*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(i*2)); printf("%d.00$",cust[i].price);
    }
    gotoxy(1,11+(i*2)); printf("==============================================================================");
    getch();
    }

    //******The Function of Program Edit ********
    void edit()
    {
    gotoxy(20,5); printf("For Editing!!! Input Customer ID="); scanf("%d",&e); clrscr();
    draw();
    gotoxy(30,3); printf("Customer %04d",e);
    gotoxy(10,6); printf("Name=%s -> ",cust[e-1].name); fflush(stdin); gets(cust[e-1].name);
    gotoxy(10,8); printf("Input Date Check In=%d/%d/%d -> ",cust[e-1].da_in.day,cust[e-1].da_in.month,cust[e-1].da_in.year);
    scanf("%d%c%d%c%d",&cust[e-1].da_in.day,&a,&cust[e-1].da_in.month,&b,&cust[e-1].da_in.year);
    again:
    gotoxy(10,10); printf("                                       ");
    gotoxy(10,10);printf("Room Number=%d -> ",cust[e-1].n_of_room); scanf("%d",&room);
    if( room<101 || room>109 && room<201 || room>209 && room<301 || room>309)
       { gotoxy(10,10); printf("NO that Room!!!");
    getch(); goto again; }
    for(i=0;i<ID;i++)
    {if(cust[i].n_of_room==room && room!=cust[e-1].n_of_room)
    {gotoxy(10,10); printf("Room Number %d Aready Exist",room);
    getch(); goto again;
    }
    }
    again1:
    gotoxy(10,12); printf("                                       ");
    gotoxy(10,12); printf("Type of Room=%c -> ",cust[e-1].room); fflush(stdin); scanf("%c",&cust[e-1].room);
    if(cust[e-1].room!='D' && cust[e-1].room!='d' && cust[e-1].room!='S' && cust[e-1].room!='s')
    {gotoxy(10,12); printf("Error type of room must be D or S ");getch();
    goto again1;}

    cust[e-1].id=e;
    if(cust[e-1].room=='D' || cust[e-1].room=='d')
    cust[e-1].price=20;
    if(cust[e-1].room=='S' || cust[e-1].room=='s')
    {cust[e-1].price=15;}
    cust[e-1].n_of_room=room;
    cust[e-1].da_out.day=0;
    cust[e-1].da_out.month=0;
    cust[e-1].da_out.year=0;

    }

    //******The Function of Program Draw table ********
      void draw()

      {

    gotoxy(8,27);printf("ÉÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍËÍÍÍÍÍ»");
    gotoxy(8,28);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,29);printf("º     º     º     º     º     º     º     º     º     º <- Third Floor");
    gotoxy(8,30);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,31);printf("ÌÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍ͹");
    gotoxy(8,32);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,33);printf("º     º     º     º     º     º     º     º     º     º <- Second Floor");
    gotoxy(8,34);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,35);printf("ÌÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍÍÎÍÍÍÍ͹");
    gotoxy(8,36);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,37);printf("º     º     º     º     º     º     º     º     º     º <- First Floor");
    gotoxy(8,38);printf("º     º     º     º     º     º     º     º     º     º");
    gotoxy(8,39);printf("ÈÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍÍÊÍÍÍÍͼ");
    for(i=0;i<9;i++)
    {
    gotoxy(10+(6*i),29);
    for(j=0;j<ID;j++)
    {
    if(cust[j].n_of_room==301+i)
    {
    textcolor(RED);
    }
    }
    cprintf("%d",301+i); textcolor(WHITE);

    gotoxy(10+(6*i),33);
    for(j=0;j<ID;j++)
    {
    if(cust[j].n_of_room==201+i)
    {
    textcolor(RED);
    }
    }
    cprintf("%d",201+i); textcolor(WHITE);


    gotoxy(10+(6*i),37);
    for(j=0;j<ID;j++)
    {
    if(cust[j].n_of_room==101+i)
    {
    textcolor(RED);
    }
    }
    cprintf("%d",101+i); textcolor(WHITE);
    }

      }
     
    //******The Function of Program Search ********
      void search()
    {
    again:
    clrscr();
    int f=0; int d,m,y; char sn[20]; int si, room;
    gotoxy(30,3); printf("Search List of Customer");
    gotoxy(3,10); printf(">>Please Press Any Keys Below");
    gotoxy(8,12); printf("1/Search by ID");
    gotoxy(8,14); printf("2/Search by Date(Check In)");
    gotoxy(8,16); printf("3/Search by Date(Chck Out)");
    gotoxy(8,18); printf("4/Search by Name of Customer");
    gotoxy(8,20); printf("5/Search by No_of_Room");
    char ch1; ch1=getch(); clrscr();

    switch(ch1)
    {
    case'1':gotoxy(5,3);
    printf("For Searching!!! Enter Customer ID="); scanf("%d",&si);
    j=0;
    clrscr();
    for(i=0;i<ID;i++)
    {if(cust[i].id==si)
    {
    f=1;
    gotoxy(1,11+(j*2));
    gotoxy(1,11+(j*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(j*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(j*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(j*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(j*2)); printf("%d.00$",cust[i].price);
    j++;
    }
    }
    gotoxy(1,11+(j*2)); printf("==============================================================================");
    break;
    case'2':gotoxy(5,3);
    printf("For Searching!!! Enter Customer Date Check In=");
    scanf("%d%c%d%c%d",&d,&a,&m,&b,&y);
    j=0;
    clrscr();
    for(i=0;i<ID;i++)
    {if(cust[i].da_in.day==d && cust[i].da_in.month==m && cust[i].da_in.year==y)
    {
    f=1;
    gotoxy(1,11+(j*2));
    gotoxy(1,11+(j*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(j*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(j*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(j*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(j*2)); printf("%d.00$",cust[i].price);
    j++;
    }
    }
    gotoxy(1,11+(j*2)); printf("==============================================================================");
    break;
    case'3':gotoxy(5,3);
    printf("For Searching!!! Enter Customer Date Check Out=");
    scanf("%d%c%d%c%d",&d,&a,&m,&b,&y);
    j=0;
    clrscr();
    for(i=0;i<ID;i++)
    {if(cust[i].da_out.day==d && cust[i].da_out.month==m && cust[i].da_out.year==y)
    {
    f=1;
    gotoxy(1,11+(j*2));
    gotoxy(1,11+(j*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(j*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(j*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(j*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(j*2)); printf("%d.00$",cust[i].price);
    j++;
    }
    }
    gotoxy(1,11+(j*2)); printf("==============================================================================");
    break;
    case'4':gotoxy(5,3);
    printf("For Searching!!! Enter Customer Name=");
    fflush(stdin); gets(sn);
    j=0;
    clrscr();
    for(i=0;i<ID;i++)
    {if(strcmp(cust[i].name,sn)==0)
    {
    f=1;
    gotoxy(1,11+(j*2));
    gotoxy(1,11+(j*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(j*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(j*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(j*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(j*2)); printf("%d.00$",cust[i].price);
    j++;
    }
    }
    gotoxy(1,11+(j*2)); printf("==============================================================================");
    break;
    case'5':gotoxy(5,3);
    printf("For Searching!!! Enter Room Number="); scanf("%d",&room);
    j=0;
    clrscr();
    for(i=0;i<ID;i++)
    {if(cust[i].n_of_room==room)
    {
    f=1;
    gotoxy(1,11+(j*2));
    gotoxy(1,11+(j*2)); printf("%03d",cust[i].id);
    gotoxy(8,11+(j*2)); printf("%s",cust[i].name);
    gotoxy(23,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_in.day,cust[i].da_in.month,cust[i].da_in.year);
    gotoxy(38,11+(j*2)); printf("%02d/%02d/%04d",cust[i].da_out.day,cust[i].da_out.month,cust[i].da_out.year);
    gotoxy(57,11+(j*2)); printf("%d",cust[i].n_of_room);
    gotoxy(69,11+(j*2)); printf("%c",cust[i].room);
    gotoxy(73,11+(j*2)); printf("%d.00$",cust[i].price);
    j++;
    }
    }
    gotoxy(1,11+(j*2)); printf("==============================================================================");
    break;
    default: gotoxy(3,27); printf("Error Enter Again!!");getch(); goto again;
    }
    if(f==0) {clrscr(); gotoxy(20,20); printf("Can not Find!!!");
    getch(); goto again;}
    gotoxy(30,3); printf("List of Customer");
    gotoxy(1,7); printf("ID");
    gotoxy(8,7); printf("Name");
    gotoxy(24,7); printf("Check_in");
    gotoxy(39,7); printf("Check_out");
    gotoxy(54,7); printf("NO_of_Room");
    gotoxy(67,7); printf("room");
    gotoxy(74,7); printf("Price");
    gotoxy(1,9); printf("==============================================================================");
        gotoxy(80,50);getch();
    }

    Restaurant Management System in C Programming


    Restaurant Management System - C implementation

    Royal University of Phnom Penh
    Computer Science Campus
    College of Computer Management and Information Technology

    A Partial Fulfillment of the Subject C Programming
    Download Here
    This is the source codes of Restaurant Management in C Programming :

    ============================================


    #include<stdio.h>
    #include<conio.h>
    #include<string.h>
    #include<dos.h>
    #include<stdlib.h>
    #include<ctype.h>
    #include<string.h>
    #include<process.h>

    struct menurec{ char number[30];
    char name[30];
    float price;
    int customer;
    }menu;

    struct orderbill{ char bid[30];
     char bnumber[30];
     char bname[30];
     float bprice;
     float btotal;} ord[30];


    void printxy(int x,int y,char string[])
    {gotoxy(x,y); printf("%s",string);}

    void center(int y,char string[])
    {int x=(80-strlen(string)+1)/2;
    gotoxy(x,y);printf("%s",string);}

    void twolinebox(int x1,int y1,int x2,int y2)
    {int x,y;
     gotoxy(x1,y1); printf("É"); //alt-201
     gotoxy(x2,y1); printf("»"); //alt-187
      for(y=y1+1;y<y2;y++){
        gotoxy(x1,y); printf("º"); //alt-186
        gotoxy(x2,y); printf("º"); //alt-186
      }
     gotoxy(x1,y2); printf("È"); //alt-200
     gotoxy(x2,y2); printf("¼"); //alt-188
      for(x=x1+1;x<x2;x++){
        gotoxy(x,y1); printf("Í"); //alt-205
        gotoxy(x,y2); printf("Í"); //alt-205
      }
     gotoxy(x1+1,y1+1);
    }

    void createmenu(void)
    { FILE *fp;
      char opt;
      center(21,"WARNING!!!");
      center(22,"You are about to create a new Menu Record");
      center(23,"This will erase all records in the Record...");
      center(24,"Are you sure you want to proceed?[Y/N] ");
      opt=getche(); opt=toupper(opt);
      if(opt=='Y'){
       fp=fopen("Group3.txt","w");
       center(24,"                                             ");
       center(24,"File successfully created!");
      }
       getch();
     fclose(fp);
    }

    void addmenu(void)
    {    char opt; int i,n;FILE *fp;
       fp=fopen("Group3.txt","a");
     //  clrscr();
     //  printf("How many foods or drinks you want to add?"); scanf("%d",&n);
      clrscr();
       twolinebox(2,6,79,20);
       twolinebox(2,20,79,24);
       twolinebox(2,2,79,24);
       center(4,"ADD MENU RECORD");
       printxy(6,8,"Number: "); gotoxy(19,8); fflush(stdin);gets(menu.number);
       printxy(6,10,"Name: ");gotoxy(19,10); fflush(stdin);gets(menu.name);
       printxy(6,12, "Price: "); gotoxy(19,12);fflush(stdin); scanf("%f",&menu.price);
       gotoxy(5,22); clreol(); printxy(79,22,"º");
       fprintf(fp," %s %s %f ",menu.number,menu.name,menu.price);
       gotoxy(5,21); clreol(); center(21,"Record successfully added!");
       printxy(79,21,"º");  gotoxy(53,22); delay(1000);


       center(22,"Press Esc to go to main menu..."); getch();
       fclose(fp);

    }

    void listmenu(void)
    {int count=0,i,x=0,page=1;
    FILE *fp;
    fp=fopen("Group3.txt","r");


     clrscr();
     center(2,"Kingdom of Wander, Cambodia");
     center(3,"Ly Meng Restaurant");
     center(5,"The most popular Restaurant in the World");
     printxy(10,7,"Number Name Price");
     for(i=1;i<80;i++){ gotoxy(i,8); puts("Í"); /*Alt-205*/ }
     i=0;
     while(fscanf(fp," %s %s %f ",&menu.number,&menu.name,&menu.price)!=EOF)
    {
        if(count!=0&&count%5==0){ printxy(5,23,"Press any key to continue..."); getch(); x=0;
      for(i=10;i<=24;i++){gotoxy(1,i); clreol();}
        page++;
        }
        gotoxy(70,4); printf("Page %d",page);
        gotoxy(19,10+x); printf("%s",menu.number);
        gotoxy(37,10+x); printf("%s",menu.name);
        gotoxy(62,10+x); printf("%f",menu.price);
        x++;
      count++;
    }
     printxy(5,23,"Press any key to go to main menu...");
     getch();

     fclose(fp);
    }

    void addorder(void){
       int i=0,n,count=1;
       ord[i].btotal=0;   FILE *fp1; FILE *co;
       fp1=fopen("Group3order.txt","w");
       if(fp1==NULL)
       { puts("Can't Open File");
    getch();
    exit(1);
       }
       printf("Please Remember Your Number of food or drink choice to put in the order!");
       listmenu(); delay(1000);
       printf("Now press any key to enter your choice!");
       char opt1=getch();clrscr();
       printf("Customers Number %d",i+1);
       printf("\nHow Many Items You want to order?"); scanf("%d",&n);

       clrscr();
       twolinebox(2,6,79,20);
       twolinebox(2,20,79,24);
       twolinebox(2,2,79,24);
       center(4,"ADD ORDER");
       gotoxy(6,8);printf("Customer Number %d",count);   count++;
       for(i=0;i<n;i++){
       printxy(6,i+9,"Number= ");gotoxy(i+18,i+15);fflush(stdin); gets(ord[i].bnumber);
       printxy(6,i+10,"Price= "); gotoxy(i+18,i+16); fflush(stdin);scanf("%f",&ord[i].bprice); }
       for(i=0;i<n;i++)
       ord[i].btotal=ord[i].btotal+ord[i].bprice;
       gotoxy(6,i+3);printf("Total: %f",ord[i].btotal);
       gotoxy(5,22); clreol(); printxy(79,22,"º");
       fprintf(fp1," %s %f %f ",ord[i].bnumber,ord[i].bprice,ord[i].btotal);
       gotoxy(5,21); clreol(); center(21,"Order successfully added!");
       printxy(79,21,"º");  gotoxy(53,22); delay(1000);


       for(i=0;i<n;i++)
       fprintf(fp1," %s %s %f %f ",ord[i].bnumber,ord[i].bname,ord[i].bprice,ord[i].btotal);
       fclose(fp1);     co=fopen("Count.txt","w");
       fprintf(co," %d ",count); fclose(co);
       center(22,"Press Esc to go to main menu..."); getch();

    }

    void listorder(void){
    int count=0,i,x=0,page=1;
    FILE *fp;
    fp=fopen("Group3.txt","r");


     clrscr();
     center(2,"Kingdom of Wander, Cambodia");
     center(3,"Ly Meng Restaurant");
     center(5,"Reciept");
     printxy(10,7,"Number Name Price");
     for(i=1;i<80;i++){ gotoxy(i,8); puts("Í"); /*Alt-205*/ }
     i=0;
     while(fscanf(fp," %s %s %f %f ",&ord[i].bnumber,&ord[i].bname,&ord[i].bprice,&ord[i].btotal)!=EOF)
    {
        if(count!=0&&count%5==0){ printxy(5,23,"Press any key to continue..."); getch(); x=0;
      for(i=10;i<=24;i++){gotoxy(1,i); clreol();}
        page++;
        }
        gotoxy(70,4); printf("Page %d",page);
        gotoxy(13,10+x); printf("%d",count+1);
        gotoxy(19,10+x); printf("%s",ord[i].bnumber);
        gotoxy(37,10+x); printf("%s",ord[i].bname);
        gotoxy(62,10+x); printf("%f",ord[i].bprice);
        x++;
      count++;
     }
     printxy(5,23,"Press any key to go to main menu...");
     getch();

     fclose(fp);
    }
    void sale(void){
    int count=0,i,x=0,page=1;
    FILE *fp1;
    fp1=fopen("Group3order.txt","r");


     clrscr();
     center(2,"Kingdom of Wander, Cambodia");
     center(3,"Ly Meng Restaurant");
     center(5,"Reciept");
     printxy(10,7,"Number Name Price");
     for(i=1;i<80;i++){ gotoxy(i,8); puts("Í"); }
     i=0;
     while(fscanf(fp1," %s %s %f %f ",ord[i].bnumber,ord[i].bname,&ord[i].bprice,&ord[i].btotal)!=EOF)
    {
        if(count!=0&&count%5==0){ printxy(5,23,"Press any key to continue..."); getch(); x=0;
      for(i=10;i<=24;i++){gotoxy(1,i); clreol();}
        page++;
        }
        gotoxy(70,4); printf("Page %d",page);
        gotoxy(13,10+x); printf("%d",count+1);
        gotoxy(19,10+x); printf("%s",ord[i].bnumber);
        gotoxy(37,10+x); printf("%s",ord[i].bname);
        gotoxy(62,10+x); printf("%f",ord[i].bprice);
        x++;
      count++;
     }
     printxy(5,23,"Press any key to go to main menu...");
     getch();

     fclose(fp1);
    }

    void Quit(void)
    {clrscr();
     twolinebox(2,2,79,24);
     center(8,"PROGRAMMED");
     center(9,"BY");
     center(11,"Group 3");
     center(13,"Ly Meng, Nheb Chhat Chhaya");
     center(14,"Oum Serey Chan, Pann Malinet");
     center(15,"Oeng Kean Hourt, Meng Sophea");
     center(16,"On Chetra, Oum Makara");
     delay(5000);
     exit(1);
    }

    void Err_mess(void){
    sound(1000);
    center(22,"Invalid Input!");
    delay(1000);
    nosound();
    }


    void main()
    {char choice;
        do{
         clrscr();
         twolinebox(2,20,79,25);
         twolinebox(2,2,79,25);

         center(4,"MAIN MENU");
         printxy(30,6,"Press:");
         printxy(30,8,"[1]-Create Menu");
         printxy(30,9,"[2]-Add Menu");
         printxy(30,10,"[3]-List Menu");
         printxy(30,11,"[4]-Add Order");
         printxy(30,12,"[5]-List Order");
         printxy(30,13,"[6]-Sale");
         printxy(30,14,"[7]-Exit");
         printxy(30,15,"Enter your choice..."); gotoxy(50,13);
         choice=getch(); choice=toupper(choice);
           switch(choice){
     case '1': createmenu(); break;
     case '2': addmenu(); break;
     case '3': listmenu(); break;
     case '4': addorder(); break;
     case '5': listorder(); break;
     case '6': sale(); break;
     case '7': Quit(); break;
     default: Err_mess(); break;
           }
         }while(choice!='7');
    }

    //Leave us a command and share it to your friends ..!