Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 06.04.2006, 09:12   #16
Silence
 
Moonlight's Avatar
 
Join Date: 11 2004
Location: back to meta level
Posts: 3,926
Downloads: 1
Uploads: 0
Blog Entries: 3
Reputation: 202 | 3
Default Re: vaild account

Quote:
Originally Posted by acid
is this your homework at uni?
or maybe it's his job & he's earning money in forum. acid, charge taxes!

p.s. oy do chego j bivayu vrednoy
Reply With Quote
Old 10.04.2006, 03:23   #17
Дошкольник
 
Diane-'s Avatar
 
Join Date: 04 2003
Location: USA
Posts: 103
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: vaild account

that should work and stop after valid number was found. You can change condition to search entire array by removing boolean flag, . Its a simple program and should be able to do it yourself .

Code:
#include <iostream>
using namespace std;
void searchlist (double [],int,double);
const int index = 18;
int main()
{
double num;
double Account[index]=
{5658845, 4520125, 7895122, 8777541, 8451277, 1302850,
8080152, 4562555, 5552012, 5050552, 7825877, 1250255,
1005231, 6545231, 3852085, 7576651, 7881200, 4581002 };

cout << "enter Number\n";
cin >> num;

searchlist(Account,index,num);
system("pause");
return 0;
}

void searchlist(double list [index],int index,double value)
{
     bool found=false;
     int i=0;
     
          while (i<=index && !found)
          {
          if (list [i] == value)
            {
            cout<<"Valid"<<endl;
            found=true;
            }
          else
            cout<<"Invalid"<<endl;
          i++;
            }
}
Reply With Quote
Old 12.04.2006, 03:54   #18
Младенец
 
imjustagirl's Avatar
 
Join Date: 03 2006
Location: san fan
Age: 36
Posts: 15
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: vaild account

im a girl and no its not for a job its just homework in a class i am taking a majority of the programs i write on my own but i tend to get stuck on some things. so i ask for help in on here much easier then getting a hold of my professor. i got the account validation to work good but thanks for the help Diane, this is the first time i have even tried programing i just learned how to use the internet sad huh.
Reply With Quote
Old 12.04.2006, 08:55   #19
Easy rider
 
Silver's Avatar
 
Join Date: 11 2005
Location: tristeza
Age: 32
Posts: 1,082
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: vaild account

Woot, Girl Power!
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 20:42.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.