Skip to content

Instantly share code, notes, and snippets.

@bvancil
Last active December 30, 2015 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bvancil/7881777 to your computer and use it in GitHub Desktop.
Save bvancil/7881777 to your computer and use it in GitHub Desktop.
A Madlib invented by John C. to teach 8th graders about programming.
#include <iostream>
#include <string>
using namespace std;
int main()
{
// This is a madlib. Enter the following parts of speech below.
string adj1 = ""; // Adjective
string noun1 = ""; // Noun
string place1 = ""; // Name of a place
int num1 = 0; // Integer number
string noun2 = ""; // Plural noun
string adj2 = ""; // Adjective
int num2 = 0; // Integer number
string time1 = ""; // Unit of time, e.g. days, minutes, or years
string verb1 = ""; // Present or future tense, singular
string adv1 = ""; // Adverb
string emo1 = ""; // Emotion adjective
string grade1 = ""; // Letter Grade, e.g. A+, F
/*
Don't peek below until you fill out the parts of speech above.
Then run the program!
*/
// Hey, I said no peeking!
cout << "\tThe very " << adj1 << " " << noun1 << " went to the " << place1 << " to buy " << num1 << " " << noun2 << ". The " << noun1 << " was stopped by the " << adj2 << " teacher. \"Have you done your homework?\" she asked. \"It was due " << num2 << " " << time1 << " ago!\"\n\t\"No,\" the " << noun1 << "replied. \"Can I " << verb1 << " instead?\"\n\"Fine,\" she said.\n\tSo the " << noun1 << " " << adv1 << " " << verb1 << " until he got " << emo1 << ", and he still only got a grade of " << grade1 << "." << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment