Help with my c++ assignment

Pages: 12
Duthomhas wrote:
With introductory homeworks you will not likely have problems with plagarism.

It would also have come up with your username. And about thirty years worth of identically-titled requests for help.

Fact is, you are just being antisocial and spitting in the faces of everyone who tried to help you. Learn to behave online, and you can go far. Flaunt basic behavioral norms, and you can expect to be disliked and mistreated.

If you want private help with stuff, go ask in the Jobs section, and be honest and say you want it for free. A good number of regulars and lurkers will help you anyway.

Ask for public help, and then toss away the time of everyone who tried to help...


yeah, your bad.



At this point, you can learn something, or, as it currently appears you intend to do, learn nothing. Good luck with that!
closed account (E0p9LyTq)
Wow, this certainly went badly. From PMing demands for help to the OP saying they were going to delete all their work to stop others from plagiarizing their "hard work."

Yes, they said something like that before everything went *POOF!*
closed account (z05DSL3A)
robinho wrote:
Well I might have pissed someone off lol
It would have been an automatic response to your own actions most likely.
closed account (E0p9LyTq)
Your actions sure said otherwise. Good intentions can pave a highway to hell.
Just learn and be happy!
closed account (E0p9LyTq)
You sure are one arrogant sod.
@FurryGuy
The first rule of disengagement is... stop responding.
closed account (E0p9LyTq)
Arrogant because you think you deserve something. When it was your actions that started this affair.

Oh what the hell, I'm done. With this discussion and you.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
#include <cstdlib>
#include <cctype>
#include <random>
#include <chrono>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

struct Action
{
   string description;
   void (*func)( string &str );
};

mt19937 rng( chrono::system_clock::now().time_since_epoch().count() );

int main()
{
   vector<Action> opt = { { "Exit"      , []( string &str ){ exit( 0 );                               } },
                          { "Enter word", []( string &str ){ cout << "Enter word: ";   cin >> str;    } },
                          { "Reverse"   , []( string &str ){ reverse( str.begin(), str.end() );       } },
                          { "Randomise" , []( string &str ){ shuffle( str.begin(), str.end(), rng );  } },
                          { "Uppercase" , []( string &str ){ for ( char &c : str ) c = toupper( c );  } },
                          { "Lowercase" , []( string &str ){ for ( char &c : str ) c = tolower( c );  } },
                          { "Sort"      , []( string &str ){ sort( str.begin(), str.end() );          } } };
   string word;
   int N = opt.size();
   int ans;

   while( true )
   {
      for ( int i = 0; i < N; i++ ) cout << i << ": " << opt[i].description << '\n';
      cin >> ans;   if ( ans < 0 || ans >= N ) continue;
      opt[ans].func( word );
      cout << "Current word is " << word << "\n\n";
   }
}
Topic archived. No new replies allowed.
Pages: 12