Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Need some help with C++.. I know you're not supposed to post your assignments here, but I don't want you to write the program. I'm just trying to understand the assignment.
 one year ago
 one year ago
Need some help with C++.. I know you're not supposed to post your assignments here, but I don't want you to write the program. I'm just trying to understand the assignment.
 one year ago
 one year ago

This Question is Closed

bahrom7893Best ResponseYou've already chosen the best response.2
So far what I got from this is: A random person requests to buy a certain number of lots (100 shares), at a certain price per share. So, the total price would be: price per stock * (# of lots)/100
 one year ago

bahrom7893Best ResponseYou've already chosen the best response.2
and i didn't follow anything else.. Is all the info supposed to go into some vector? Can someone give me a few pointers?
 one year ago

bahrom7893Best ResponseYou've already chosen the best response.2
same here.. i have no darn clue what the heck the prof wants.. I'll prolly go talk to him on monday...
 one year ago

bahrom7893Best ResponseYou've already chosen the best response.2
yea, he mixed up the account numbers.
 one year ago

bahrom7893Best ResponseYou've already chosen the best response.2
i think it is.. im just not following what the program shld be doing.. And he's like use a vector, when he didn't even explain those. Not a big deal, i can read up on them, but still..
 one year ago

mohd.jasBest ResponseYou've already chosen the best response.1
I'm not sure about the Vector part either (something like a linked list? *shrug*), but here's what I understood from the sample run: The 'bid' commands are from the buyers in the format 'bid account_number number_of_lots bid_price_per_lot'. Initially the offer price is 25, and the first two bids don't have an offer greater than or equal to this. The third bid, however, is at 27 per lot, so it's executed immediately. The next command 'offer', changes the offer price per lot, in the format 'offer new_price'. So after 'offer 24', we have the price set at 24. However from the earlier two bids, one of them has an offer that meets this price, so that is executed. Then 'offer 25' doesn't cause any more executions because none of the pending or current transactions match. And that's how it goes. The only thing left is what your professor meant by 'vector'.
 one year ago

oldrin.batakuBest ResponseYou've already chosen the best response.2
Your professor is referring to an std::vector (see: http://en.cppreference.com/w/cpp/container/vector), a C++ standard library container. It is more flexible to use than an array and grows dynamically. You don't NEED to use an std::vector, but it provides functionality for the list of sales orders.
 one year ago

mohd.jasBest ResponseYou've already chosen the best response.1
@oldrin.bataku : So it is basically like a linked list, yeah? I'm not very wellversed with C++.
 one year ago

oldrin.batakuBest ResponseYou've already chosen the best response.2
No, a linked list is a different structure... though both can be used to implement a list. An std::vector generally stores an array that is reallocated when necessary to resize... the reason it can't be a typical linked list is because of the constraints the C++ standard places on the complexity of its operations. For example, random access in a linked list (std::slist, std::list) is O(n), while in an std::vector it is required to be O(1) (like an array).
 one year ago

mohd.jasBest ResponseYou've already chosen the best response.1
Oh, okay. I just read more on it now. Can see the difference. :) Thanks!
 one year ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.