Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    292
  • comments
    557
  • views
    154095

My Reign of Mischief on Kasamba

Sign in to follow this  
TANSTAAFL

94 views

I joined Kasamba a while ago, and immediately noticed a few things:

1) Most of the questions on the public forum concerning programming were people who wanted to pay others to do their homework for them.

2) Most of the folks responding to these queries are from India and other similar places.

This bothers me because if the folks who are learning to program don't learn to program, it further justifies the outsourcing of programming jobs to India. This also bothers me because the kids aren't doing their own homework assignments, thus reinforcing the idea that americans are lazy.

So, I decided to declare a personal war on the programmers of India, and this is my call to arms.

What I do is find one of these homework questions, and I provide the answer to it. One example is the "calculate the area of a triangle" example I did a while back.

A new example was in response to the following question:
Quote:

Write a program that asks the user to input the name, age, and sex of each of three employees. The text file output will be a table formatted as follows.
Name age sex
Doe, Jane 25 F
Smith, Raoul 31 M
Moore, Mary Lou 19 F
This is using string data type.i.e. String last_name;


And my response:

Quote:
>#include
#include
#include

class PersonRecord
{
private:
enum gender_t
{
gender_male,
gender_female,
gender_unspecified
};
typedef std::string name_t;
typedef unsigned short age_t;
name_t firstName;
name_t lastName;
age_t age;
gender_t gender;
public:
PersonRecord():firstName(""),lastName(""),age(0),gender(gender_unspecified){}
PersonRecord(const PersonRecord& personRecord):firstName(personRecord.getFirstName()),lastName(personRecord.getLastName()),age(personRecord.getAge()),gender(personRecord.getGender()){}
~PersonRecord(){}

void setFirstName(const name_t& firstName){this->firstName=firstName;}
void setLastName(const name_t& lastName){this->lastName=lastName;}
void setAge(age_t age){this->age=age;}
void setGender(gender_t gender){this->gender=gender;}

const name_t& getFirstName()const{return(firstName);}
const name_t& getLastName()const{return(lastName);}
age_t getAge()const{return(age);}
gender_t getGender()const{return(gender);}

void read(std::istream& inputStream){inputStream>>lastName>>firstName>>age;char c;inputStream>>c;if(c=='m'||c=='M'){setGender(gender_male);}else if(c=='f'||c=='F'){setGender(gender_female);}else {setGender(gender_unspecified);}}
void write(std::ostream& outputStream)const{outputStream<};

enum
{
record_count = 3
};

int main(int argc,char* argv[])
{
std::vector Records;
while(Records.size(){
PersonRecord record;
record.read(std::cin);
Records.push_back(record);
}
for(std::vector::iterator iter=Records.begin();iter!=Records.end();iter++)
{
(*iter).write(std::cout);
}
}


(forgive the formatting, I'm cutting and pasting what was actually on the website)

Now, this is a valid solution to the problem, and I purposely made the code too advanced for the kid to actually turn it in (his teacher/prof would never believe he wrote it himself).

But I got a response today:

Quote:
Ernest, I really appreciate you giving me the code like that but the code you gave me is much more complicated then I am doing right now. I need a code using string data type and using simple C++, like cin>> and c<< out and setw.


So, chances are, he'll go and hire one of the Indians anyway, but I've made my point.
Sign in to follow this  


3 Comments


Recommended Comments

It amazes me that people are actually like that, as if programming is something you don't have to learn. I wonder how they'd solve a problem at zero hour with a $3Million deadline looming above them.

Share this comment


Link to comment
So store the values in a char array in reverse order, then use cout to print the values from end-to-beginning.

Or just re-suggest the following program. . .

main()
{
cout << "please do my homework for me";
}

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!