okey hi everybody a friend of mine needs help with c++ if anybody could help ill be glad i hope people wont take it as begging.

9 years ago

Comment has been collapsed.

Kids haven't heard about google anymore these days?

9 years ago
Permalink

Comment has been collapsed.

well shes dumb i guess she tried so many times she couldnt get it done and i am like noob at C++

9 years ago
Permalink

Comment has been collapsed.

That's that thing where you find the pictures of cats right? I've heard about that.

9 years ago
Permalink

Comment has been collapsed.

Would be real useful if you mentioned what your friend needs help with...
(Or if, y'know- you googled it. :P )

9 years ago
Permalink

Comment has been collapsed.

only if i knew the problem at 1st place

9 years ago
Permalink

Comment has been collapsed.

What is Google?

9 years ago
Permalink

Comment has been collapsed.

american shit. me russki i use yandex blayd blayd...

9 years ago
Permalink

Comment has been collapsed.

You could at least write what the problem is...

9 years ago
Permalink

Comment has been collapsed.

well, state your problem, i have some experience regarding c++

9 years ago
Permalink

Comment has been collapsed.

saw c++ topic.
instant click.
found no problem to solve. :-(

9 years ago
Permalink

Comment has been collapsed.

well now u have one lol

9 years ago
Permalink

Comment has been collapsed.

The university election will start in few days … they decided to create a system that calculates the total number of votes and decide who won the election instead of counting the votes manually. There are three different groups (Hardee’s, KFC, and Krispy cream) who’ll participate in the election. The university will provide 10 boxes to carry the votes (5 boxes for the boys & 5 for the girls). You’ve been asked to create this system. Your system will read the number of votes for the participated groups from every single box (from a file) and then it should display the following information:

  • The name of the winning group and the runner up.
  • The vote difference between the winner and the runner up too.
  • The number of the voting box who granted the highest number of votes for the first group.
  • The number of the voting box who granted the highest number of votes for the second group.
  • The number of the voting box who granted the highest number of votes for the third group.
9 years ago
Permalink

Comment has been collapsed.

Still not seeing an actual question here. This is your whole assignment. Is there a specific question to ask, or are you hoping someone just does the whole thing for you?

9 years ago
Permalink

Comment has been collapsed.

exactly she wants someone to do everything for her :P

9 years ago
Permalink

Comment has been collapsed.

can u talk to her on fb she has tried something idk to me its difficult idk anything about it

9 years ago
Permalink

Comment has been collapsed.

"5 boxes for the boys & 5 for the girls"
Why the f...

9 years ago
Permalink

Comment has been collapsed.

It's like in MMO games, when someone says "Can I ask a question?" Yes, you just did. Spit it out already.

Or: "Can you help me with a mission?" It's not a meaningful question. Tell people WHICH mission so they know if they want to (or even can) help you.

If you want to ask a C++ question, ask it. Don't beat around the bush.

(Oh, and we know it's for your homework, not "a friend." That's got to be one of the oldest obfuscations in the book.)

9 years ago
Permalink

Comment has been collapsed.

i was just making sure if someone would wanna help her or not :) and no its not my homework i have passed out :D

9 years ago
Permalink

Comment has been collapsed.

that's a great deal

9 years ago
Permalink

Comment has been collapsed.

well anybody who wanna help her just tell me i will tell u guys her fb and she will tell u whats her problem ? please guys

9 years ago
Permalink

Comment has been collapsed.

#include<iostream>
using namespace std;
int main{
cout<<" Try Books.";
return 0;
}

|Smth like this help?|

9 years ago
Permalink

Comment has been collapsed.

well yes this she sent me

include <iostream>

include <fstream>

using namespace std;
int main() {

const int boxes = 10;
const int groups = 3;
int votes [boxes][groups];

ifstream in;
in.open("votes.txt");

for (int r=0;r<boxes;r++){
for (int c=0;c<groups;c++)
{in>> votes[r][c];
cout << votes [r][c]<<endl;}}
return 0;
}

now idk what shes tryna do can u talk to her directly ? on fb shes on

9 years ago
Permalink

Comment has been collapsed.

meh, I don't know how to array =d
seems right from the first glance
but games are better.

9 years ago
Permalink

Comment has been collapsed.

"smashes my head on wall"

9 years ago
Permalink

Comment has been collapsed.

Doesn't look hard if she already did that code.
Just replace arrays with std:vector for easy result counting and add few loops in the end for boxes to pick highest count for each group.
Still can't understand what is 'runner up' is that the second place after winner?

9 years ago
Permalink

Comment has been collapsed.

well, make a class for a box, give it a function to read from file (i assume the file is just a line for each vote which states the number a single person voted for and you got one file per box - if its different, just adapt the code)

class box
{
map<int32_t, int32_t> groups;

box(const string& fileName)
{
readVotes(fileName);
};

readVotes(const string& fileName);
{
fstream in;
in.open(fileName);
int32_t currentValue;
while (in >> currentValue)
{
groups[currentValue]++;
}
}

then in your main.cpp you just make a vector of boxes:

vector<box> boxes;
boxes.emplace_back(box("votes1.txt"));
...

then you can simply read out your information

9 years ago*
Permalink

Comment has been collapsed.

did't actually run the code, but as a idea how to approach the problem it should suffice.

  • do not use arrays
  • use std containers
  • make use of object orientation

if you want, you can also read the file linewise using stringstreams

9 years ago
Permalink

Comment has been collapsed.

All hail stackoverflow

9 years ago
Permalink

Comment has been collapsed.

EDIT: int this=0; //forgot to initialize it...

this++;

9 years ago*
Permalink

Comment has been collapsed.

this += 2;

9 years ago
Permalink

Comment has been collapsed.

this << 1;

9 years ago
Permalink

Comment has been collapsed.

thanx everyone ill show her what u guys have said :)

9 years ago
Permalink

Comment has been collapsed.

Sign in through Steam to add a comment.