Invincible-99's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
New Members
Active Posts:
11 (0.02 per day)
Joined:
03-May 12
Profile Views:
345
Last Active:
User is offline Jan 21 2014 12:05 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Who Cares
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0

Latest Visitors

Icon   Invincible-99 has not set their status

Posts I've Made

  1. In Topic: this input format..

    Posted 29 May 2012

    If you have not ever being paid for any programming does not mean that you're not professional. I still consider you a professional. ^__^

    That's right. well, I meant that I wish to be as professional as you in c++.
  2. In Topic: this input format..

    Posted 21 May 2012

    Thank you David.. :^:

    It's obvious that you're a professional C++ programmer..

    I wish I could be like you someday...
  3. In Topic: this input format..

    Posted 16 May 2012

    I have finally done this project. :clap:
    big thanks to you David and r.stiltskin. :flowers:
    Thank you for not writing the code for me and letting me try.
    Now I have to work on my next project. I'll ask for help when I need it.
  4. In Topic: this input format..

    Posted 10 May 2012

    Thank you #26 David W for your advice and suggestions :)

    I have done the hindu check.. it works very well :clap:

    The problem is that I want the user to type all the things that he wants to test then the program displays the results.
    struct formula
    {  int a;
       char opp;
       int b;
       char equal_sign;
       int c;
       char dot;
       
    };
    
    int main()
    {
    int i=1;
    struct formula fi;
    
    while(cin>>fi.a)
    {
    cin>>fi.opp;
    cin>>fi.b ;
    cin>>fi.equal_sign;
    cin>>fi.c;
    cin>>fi.dot;
    
    int sum1=0,sum2=0,sum3=0;
    
    while(fi.a>0)
    	    {
    	        sum1+=fi.a%10;
    	        fi.a=fi.a/10;
    		}
    	   
    	
    while(fi.b>0)
    	    {  
    	        sum2+=fi.b%10;
    	        fi.b=fi.b/10;	
    	    }
    
    while(fi.c>0)
    	    {
                sum3+=fi.c%10;
    	        fi.c=fi.c/10;
             } 
    		
    	
    		if(fi.opp=='*')        //checking multiplication
    		{if( sum1*sum2%9 ==  sum3%9 )
    			cout<<i<<". PASS\n";
    		else
    			cout<<i<<". NOT!\n"; 
    		}
    		
    		else if(fi.opp=='+')     //checking addition
    		{if( (sum1+sum2)%9 == sum3%9)
    	     cout<<i<<". PASS\n";
            else
    			cout<<i<<". NOT!\n";
    		}
    
    	
    		i++;
    	}
    
    
    
    return 0;
    
    }//end main
    
  5. In Topic: this input format..

    Posted 4 May 2012

    View Postaresh, on 04 May 2012 - 01:32 PM, said:

    @r.stiltskin : What is clever about the use of structure in the code ?? That you have to address every variable by writing fi.variable ?? And, how in the world can cin actually recognize the difference b/w a char and a number, not even separated by whitespace ?? If you declare an int a, and write cin>>a; and try to input a character, it will happily accept it and crash/produce garbage result. So how in the world can it differentiate b/w these diff. types of inputs ??

    Thank you aresh. I don't prefer using string because I'm just a beginner.
    Please try my program it works well :wink:

My Information

Member Title:
New D.I.C Head
Age:
22 years old
Birthday:
January 3, 1992
Gender:

Contact Information

E-mail:
Private

Friends

Comments

Page 1 of 1
  1. Photo

    David W Icon

    07 Jun 2012 - 01:46
    Nice problem you posted ... keep it up :)
Page 1 of 1