1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

Programming.. patulong! visual studio c++ 2010 express

Discussion in 'Web & Internet' started by keith18, Mar 13, 2013.

  1. hulala.. ito na naman po ako.. whaha.. hirap ng bago, di alam kung san dapat ipost ang topic ko.. pagpasensyahan nyo na po ha.. thanks, patulong po sana ako sa programming, ito yung code code ko:
    #include <iostream>
    #include <string>
    using namespace std;
    using std::cout;
    using std::cin;


    int main()
    {
    int n;
    char c;
    string input,q1,q2,q3,q4,q5;
    for (n=0;n<5;n++);
    cout<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q1=input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q2=q1 + input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input =="0"){
    q5=q2 + input;
    cout<<endl<<"Input String:"<<q5<<endl;
    }
    }

    else{
    q5=q1 + input;
    cout<<endl<<"Input String;"<<q5<<endl;
    }
    }
    else{
    q3=input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q4=q3 + input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q5=q4 + input;
    cout<<endl<<"Input String:" <<q5<<endl;
    }
    }
    else{
    q1=q3 + input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q2=q1 + input;
    cout<<endl<<"Type an input [0 or 1]";
    cin>> input;
    if (input=="0"){
    q5=q2 + input;
    cout<<endl<<"Input String:" <<q5<<endl;
    }
    }
    else{
    q5=q1 + input;
    cout<<endl<<"Input String;"<<q5<<endl;
    }
    }
    }
    //code para malaman kung valid or invalid
    if (q5=="000" ||q5=="1100" ||q5=="111" ||q5=="100" ||q5=="01"){
    cout<<endl<<"VALID"<<endl;
    }
    else{
    cout<<endl<<"INVALID"<<endl;
    }
    //para tumigil sandali
    cout<<endl<<"Type any character then press enter key to continue";
    cin>>c;
    return 0;
    }

    ano yung code para kapag ngtype ako ng any character and hit enter e magcocontinue? tong akin kase, once i type any character and press enter, nawawala na, bumabalik na sa coding ulit, haha.. patulong,
     
  2. Causing Glenn

    Causing Glenn daemonX Staff Member Moderator

    thread moved to web & internet> Programming...
     
  3. hahaha,tama,loop gamitin mo,hanggang kelan ang counting?input po ba ang ika-count nya?matagal na ako hindi nakapagprogram more than 8yearz na pala,nakalimutan ko na ibang function,bigay mu nga yung problem at try ko gawa ng flow charting kung alam ko pa,haha
     
  4. okay na yang code boss, walang error,. ang gusto lang mangyari, kapag knilick ko yung enter, magcocontinue ulit sya sa paghingi ng input, May nakalgay jan na Press any character and enter to continue..
     
  5. nakalimutan ko na mga ibang function,pwede mu yan gamitan din ng do while,
    ipaloob mu lang yang ginawa mu sa do while,magdeclare ka ng char ulit.
     
  6. nakalimutan ko na mga ibang function,pwede mu yan gamitan din ng do while,
    ipaloob mu lang yang ginawa mu sa do while,magdeclare ka ng char ulit.
     


  7. okay na dudes. nagawa ko na. :) thanks!