Ask your own question, for FREE!
Computer Science 21 Online
OpenStudy (anonymous):

Please help!!!!!!!!!!!!!! Using the C programming language, write programs for: Receive a set of 20 integers and store them in a structure type vector. Then calculate and display on the screen: a) amount of positive numbers; b) amount of negative numbers; c) sum of the numbers; d) average of the numbers; e) amount of even numbers; f) greater number; g) fewer.

OpenStudy (e.mccormick):

C or C++? If I recall, there is no vector in C, just C++. http://www.cprogramming.com/tutorial/stl/vector.html

OpenStudy (anonymous):

C

OpenStudy (e.mccormick):

Then you will need to start by building vector. Once it is made, you can use it.

OpenStudy (e.mccormick):

Found a ref: http://eddmann.com/posts/implementing-a-dynamic-vector-array-in-c/ Then vector should work as advertized: http://www.cprogramming.com/tutorial/stl/vector.html

OpenStudy (anonymous):

muito complicado..

OpenStudy (e.mccormick):

Well, as far as I have been able to find, my memory was right. Vector does not exist in C. So you need to build it to use it or replicate the functionality by doing something custom.

OpenStudy (anonymous):

exercise is too complicated, you can do?

OpenStudy (e.mccormick):

I don't write in C.

OpenStudy (lyrae):

Are you sure you're not supposed to use an array? When you're learning programming in another language than English, the teachers and books some times use the word vector (faulty) when they actually mean array. This happened to me a lot in my Swedish uni programming courses so I know the confusion... And also, I don't know your level, but to me this assignment seems to be focused at learning about loops and how to use them to store/fetch values and perform calculations.

OpenStudy (anonymous):

Everyone here is happy to help you learn, but very few want to do your homework for you, even when it's as trivial as this. If you don't want to learn, you're studying the wrong field and you should probably change direction before you reach a point where your failures will affect anyone but yourself.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!