Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-20-2006, 06:44 AM   #1 (permalink)
Paq
Registered User
 
Join Date: Feb 2006
Posts: 1
Paq is on a distinguished road
how to count inputs in an array? (visual logic)

the program is suppose to accept 10 input values and store into an array. then the program should input a target value and output how many times the target value appears inside the array.



im confused please somebody assist me!

how do i count the inputs in an array ?? it seems like im doing it the very long way..
Paq is offline   Reply With Quote
Old 02-20-2006, 11:42 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,720
redhead is on a distinguished road
Here is some pseudo code for that
Code:
Initiate a counter for input as beeing 0 (i_counter)
Initiate a counter for target as beeing 0 (t_counter)
Have a dynamicaly groving array holding inputted values
while user will provide value
     ask the user for a value
     if one is pressented
         store in your array
         add 1 to i_counter
Ask user for target value
while i_counter >= 0
    if array value at i_counter possition ==  target
        add 1 to t_counter
    subtract one from i_counter
print out t_counter
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in Visual Logic akr13 All Other Coding Languages 0 01-26-2006 07:36 AM
Simple reverse programm silex Standard C, C++ 3 01-22-2005 08:03 AM
Trying to count an array bdl PHP 3 03-07-2003 06:34 AM


All times are GMT -8. The time now is 09:51 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting