Notices
Results 1 to 5 of 5

Thread: I NEED HELP TO WRITE AN ALGORITHM

  1. #1 I NEED HELP TO WRITE AN ALGORITHM 
    New Member
    Join Date
    Jun 2010
    Posts
    2
    Write a structure algorithm to prompt the user to input 2 unequal numbers terminated by 0. It should output the highest value proccesed and a suitable label.

    THANK YOU VERY MUCH!!!!!!


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Cosmic Wizard SkinWalker's Avatar
    Join Date
    Apr 2005
    Location
    Grand Prairie, TX
    Posts
    2,377
    Ug. Sound like cavework (a.k.a. homework).

    How about nice caveman algorithm instead:
    Code:
    begin
      if hear barking 
      then
        curse like Bronson
        go outside and investigate
        if barking from wolf
        then
          domesticate the damn animal
        endif
        ask dog what matter is
        repeat
          thrash mutt
        until recall that dogs can't speak     
        investigate more scientifically
        if science hasn't been invented yet
        then
          wait a few thousand years for it to be
        endif
        if bonehead is barking for nothing
        then
          invent fire and hurl it at the mangy cur
        else
          follow it
          if it leads to dinosaur
          then
            if feeling sensible
              go back to cave
            else
              take out life insurance
              attack dino with hi-tech automatic TR-35 bludgeons
            endif
          else if leads to potentially domesticable animals eg TVs
          then
            capture sample animals using sophisticated methods 
    	  depicted on Friday's movie
          else if leads to food (eg McDonald's)
            take some home for junior
          else if leads to group of travelling salesman
            take them to club (ie pulp their mostly empty brains)
          endif
          go home with best friend (pizza, or dog if former is  
            yet to enter this stinking planet)
          reach home sweet home
          pull up a rock and meditate upon the future - invent 
    	wheel perhaps
          set alarm for 1 hour past dawn on sundial
          go back to bed
        endif
      else (if no barking heard)
        why get up?
      endif
    end.


    Reply With Quote  
     

  4. #3  
    New Member
    Join Date
    Jun 2010
    Posts
    2
    tha kool but..pleasse help me answer this question..
    Reply With Quote  
     

  5. #4 Is this what you wanted? 
    Forum Freshman
    Join Date
    Jul 2010
    Location
    New Delhi, India
    Posts
    17
    Code:
    #include <iostream.h>
    #include <conio.h>
    class work
    {
    public:
    int a,b;
    
    void enter()
    {
    clrscr();
    cout<<"Enter two numbers which are unequal and end with 10";
    cout<<"\n"
    cout<<"Enter first number":
    cin>>a;
    cout<<"\nEnter another number";
    cin>>b;
    getch();
    cout<<endl<<"Press any key to continue...";
    clrscr();
    }
    }o;
    
    void main()
    {
    clrscr();
    if((a%10)&&(b%10)&&(a!=b))
    {
    
    ---------------------------Do your stuff here-----------------------------
    break;
    }
    else
    {
    cout<<"\nWrong value entered, pleas try again...";
    }
    cout<<"\n\nPress any key to continue...";
    getch();
    }
    Reply With Quote  
     

  6. #5  
    Forum Professor Wild Cobra's Avatar
    Join Date
    Sep 2009
    Posts
    1,140
    Since this isn't serious...

    Why would you an an Al Gore Rhythm? Look what happened when he tried to get a massage a couple years back.
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •