rendered paste body#include <iostream>
#include <string>
#include <cstring>
using namespace std;
enum MLA_Choices
{
MLA_BOOK = 1,
MLA_INTERNET,
MLA_ENCYCLOPEDIA
};
void intro();
void mla(string afname, string alname, string book, string city, string publisher, unsigned int year);
int main()
{
unsigned int choice;
string fname;
string lname;
string book;
string city;
string publisher;
unsigned int year;
intro();
(cin >> choice).get();
while (cin)
{
if (choice == MLA_BOOK)
{
cout << "Enter the author's first name: ";
getline(cin, fname);
cout << "Enter the author's last name: ";
getline(cin, lname);
cout << "Enter the book's name: ";
getline(cin, book);
cout << "Enter the city's name: ";
getline(cin, city);
cout << "Enter the publisher: ";
getline(cin, publisher);
cout << "Enter the year of publication: ";
(cin >> year).get();
cout << "Your generated citation is: "; << endl;
mla(fname, lname, book, city, publisher, year);
}
(cin >> choice).get();
}
cin.get();
return 0;
}
void intro()
{
cout << "Enter one of the following choices to generate an MLA citation: " << endl;
cout << "\t1.) MLA Book Citation" << endl;
cout << "\t2.) MLA Internet Citation" << endl;
cout << "\t3.) MLA Encyclopedia Citation" << endl;
}
void mla(string afname, string alname, string book, string city, string publisher, unsigned int year)
{
cout << alname << ", " << afname << ". " << book << ". " << city << ": " << publisher << ", " << year << "." << endl;
}