# Array of Random Integers

Page 1 of 1

## 5 Replies - 1314 Views - Last Post: 24 June 2008 - 02:53 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=55505&amp;s=62249335b37a8200c3206e964140d684&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 JosegCouto

Reputation: 0
• Posts: 4
• Joined: 21-June 08

# Array of Random Integers

Posted 21 June 2008 - 07:00 PM

This is program in C

can you help me guyz solve this problem:

program that creates an array of 100 random integers in the range
1 to 100 and then, using the sequential search, searches the array 100
times using randomly generated targets in the same range. At the end of
the program, display the following statistics:
a.the number of searches completed;
b.the number of successful searches;
c.the percentage of successful searches; and
d.the average number of tests per search. //find it difficult

To determine the average number of test per search, you will need to count
the number of test for each search.Hint: You will need to add two for each
while loop and one for the last test.

MODIFY THE PROGRAM TO ACCEPT THE FOLLOWING INPUTS FROM THE USER:

What is the lower int for the range? (it is 1 in the book; it can be positive or negative)
What is the upper int for the range? (it is 200 in the book; it also can be positive or negative
but will be larger than the lower int)
How many times do you want to search the array? (it is 100 in the book; it must be a positive int)

Is This A Good Question/Topic? 0

## Replies To: Array of Random Integers

### #2 Jayman

• Student of Life

Reputation: 415
• Posts: 9,532
• Joined: 26-December 05

## Re: Array of Random Integers

Posted 22 June 2008 - 08:56 PM

[rules][/rules]

### #3 KYA

• su wtf -am -i /doing/with/my/life

Reputation: 2992
• Posts: 19,038
• Joined: 14-September 07

## Re: Array of Random Integers

Posted 23 June 2008 - 12:02 AM

There was a similar thread a few weeks ago on this very same topic. Search is your friend.

### #4 JosegCouto

Reputation: 0
• Posts: 4
• Joined: 21-June 08

## Re: Array of Random Integers

Posted 23 June 2008 - 03:08 PM

KYA, on 23 Jun, 2008 - 12:02 AM, said:

There was a similar thread a few weeks ago on this very same topic. Search is your friend.

Thank you, I found it.

### #5 JosegCouto

Reputation: 0
• Posts: 4
• Joined: 21-June 08

## Re: Array of Random Integers

Posted 24 June 2008 - 02:47 PM

KYA, on 23 Jun, 2008 - 12:02 AM, said:

There was a similar thread a few weeks ago on this very same topic. Search is your friend.

I'm a civil engineering major so honestly I'm not interested in understanding this programming thing. I just need someone to do the programm for me. Tell me how much it will cost me. thanks

I need to write a program that creates a two-dimensional array in the heap and then analyzes it to determine the minimum, maximum, and average of each column. The data are to be read from a file. The first two elements are the number of rows in the array and the number of columns in each row the file data for a 12 X 8 array are shown below.

Help direction:
The output should show the array WITHOUT the number of rows and columns,
but there should be three additional rows of numbers shown, namely the
minimum, maximum, and average of each column. You may assume that the
data consists of ints, positive, negative, or zero.
Get the last three rows to align with the other rows. For example,
don't print the words minimum, maximum, or average; otherwise,
alignmnent will be not correct.Be sure that the average is a float displayed with 2 digits after
the decimal point.There could be any number of ints per line, but for example if the
first int in the file is 12 and the second is 8, then there will be
exactly 96 ADDITIONAL ints in the file. Each int will be separated from
the next one by white space, namely, blanks, tabs, or newlines. Just
don't assume that each line has the same number of ints. Each int will be no
longer than 3 digits (but might be negative).
YOU MUST NOT DECLARE THE SIZE OF THE ARRAY. DYNAMIC ALLOCATION MUST BE USED.

12 8
838 758 113 515 51 627 10 419
212 86 749 767 84 60 225 543
89 183 137 566 966 978 495 311
367 54 31 145 882 736 524 505
394 102 851 67 754 653 561 96
628 188 85 143 967 406 165 403
562 834 353 920 444 803 962 318
422 327 457 945 479 983 751 894
670 259 248 757 629 306 606 990
738 516 414 262 116 825 181 134
343 22 233 536 760 979 71 201
336 61 160 5 729 644 475 993

Thank you so much.

### #6 JosegCouto

Reputation: 0
• Posts: 4
• Joined: 21-June 08

## Re: Array of Random Integers

Posted 24 June 2008 - 02:53 PM

KYA, on 23 Jun, 2008 - 12:02 AM, said:

There was a similar thread a few weeks ago on this very same topic. Search is your friend.

Ohh and I forgot is to write that program in C.

Did you know that I'm in the only college in ALL Florida that a civil engineering major have to do a computer science class? off course almost everyone in my class is failling. It's just crazy. I'm at University of North Florida.

I just wanted to tell you this.

I'm not a slacker. I just don't know crap about computer science. You could spend one year trying to explain me that and I would not be able to understand it.

Later and once again. I appreciate what your doing. This will make me to have a D in this class instead of an F.