#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    12
    Rep Power
    0

    Delaying program execution below


    #include <iostream>
    #include <conio.h>
    #include <Windows.h>
    using namespace std;

    int drying_revolution (int dryingspin_revolution);
    int rinsing_revolution (int rinsingspin_revolution);

    int main()
    {
    enter:
    cout<<"...CHOOSE YOUR DESIRE WASHING MODE...\n";
    cout<<"ENTER 'a' for cotton mode\n";
    cout<<"ENTER 'b' for Quick wash\n";

    int temperature_sensor=0; //reading from the temperature sensor console in degree celsius

    int rinsingspin_revolution = 0;
    int dryingspin_revolution=0; // read revolution from the motor spin console
    char washtype; //gotten from user via the buttons on the machine control

    char cotton = 'a';
    char quickwash= 'b';

    cin>>washtype;
    system("cls");
    if (washtype == cotton) //link cotton as the washtype selected by the user on the machine through console

    {

    temperature_sensor = 80; // a signal is send through the console to the heater to heat the water till the temperature sensor sense up to 80 deg celcius
    cout<<"................water heating in progress.......\n";

    cout <<"ready for cotton";
    cout<<"............washing in progress.......";
    }



    if(washtype == quickwash) // links quick wash as the washtype selected by the user on the machine through the console
    {
    temperature_sensor = 40; //a signal is send through the console to heat the heater to continue heating till the temperature sensor sense up to 40 deg celcius
    cout<<"ready for quick wash";

    }
    else
    {
    cout<<"invalid selection";
    system("cls");

    }

    int rinsing_revolution (int rinsingspin_revolution); // set the rinse spin at 1000 revolution
    {

    return 1000;
    }
    int drying_revolution (int dryingspin_revolution); //set the dry rinse at 1000revolution
    {
    return 1000;
    cout<<"drying in progress......\n";


    }

    system ("pause");
    }
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,364
    Rep Power
    1870
    Until you learn to use [code][/code] tags, few people will give your posts a second thought.

    You've been here long enough to understand that by now.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    34
    Rep Power
    2
    If I understood correctly your question, you need to use sleep(time); function.
  6. #4
  7. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,074
    Rep Power
    1802
    Originally Posted by Vincentas
    If I understood correctly your question, you need to use sleep(time); function.
    He did not actually ask a question. But in any case the code is for Windows, so in fact he would need Sleep( time_in_millisec ) - with a capital S. The POSIX sleep() function (with lower-case s) takes time in seconds.

IMN logo majestic logo threadwatch logo seochat tools logo