line 4: the array should have 10 values, not 11.
line 14: array indix values are 0 based, meaning 0, 1, 2, ... 9. There is no 10th. Count them on your fingers if you have to so that you verify to yourself that 0 to 9 is 10 values.
Also, variable num_values is not declared.
line 16: you have to put quotes around the text that you want displayed.
line 17: you need cin << array[i]; to get keyboard input
Ancient Dragon
Achieved Level 70
32,136 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69
Also, going by your guildlines, your ints need to be floats.
Doogledude123
Junior Poster in Training
90 posts since Jun 2012
Reputation Points: 0
Solved Threads: 7
Skill Endorsements: 0
It takes more than that to provide any shock value. Nice try though. Hope you had fun.
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9
line 11 contains a word that is seldom seen in programming and has no role in your program other than shock value.
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9
You need a for loop to loop through your array and everytime it doesn, check to see if the current array value is larger then the array value 0.
Try to code that, then post back on where you get stuck.
Doogledude123
Junior Poster in Training
90 posts since Jun 2012
Reputation Points: 0
Solved Threads: 7
Skill Endorsements: 0
Why start at the end of the array and fill it in towards the front. Can be done, no prob, other than being a little unconventional.
Try to write code that displays 2 elements of the array. Post that code if it this post doesn't contain enough of a clue what to do.
What operators are used to compare variables?
You need to be a little careful when comparing floating point numbers, but that isn't the crux of your problem at this point.
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9
const int MAX = 10
int A [MAX]
int higherInts[MAX]
int numElement = 0
for (int i = 0; i < MAX; ++i)
input MAX ints into A
use another loop ranging from 1 to MAX - 1
if first element of A lesss than current element of A
store current element of A at index equal to numElement in higherInts
adjust value numElement appropriately
Number of elements in higherInts are all greater than first element of A
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9
The pseudocode uses one loop to enter the values into an array and another to test whether elements in the array are larger than the first element, or not. If the current element is larger than the first one then the current element is store in another array, the index of which is the number of elements actually in the array. You can use the second array later if you want to. For example you can use it to print out all the elements in the second array if you want to. You could of course print out each value greater than the one in with index 0 in the first array as you find it and just use the counter as a counter instead of using the counter as an index for the second array, but it looks like you could use the practice using arrays, so why not take advantage of a classic situation where arrays are used?
Lerner
Nearly a Posting Maven
2,406 posts since Jul 2005
Reputation Points: 739
Solved Threads: 405
Skill Endorsements: 9