My school insists that all work needs to be handed in with a bibliography adn naturally, they insist on using an incredibly complicated method of writing a bibliography, which becomes very time consuming. Im relatively new to C++ and i decided to write a program to make writing bibliographies a bit easier. I have just started writing my program and was testing its first function, which is writing a bibliography for a book. What my program does, is make a html page which contains the bibliography written in the method that my school requires.
The problem with my program occurs when you use more than one word. e.g. the title contains more than one word. what happens is either, the bibliography is written with each word in the name, as a different part of the bibliography. (Im sorry, that part is a little hard to explain) or, the entire program gets repeated over and over in an endless cycle without stopping even when it reaches a spot where the user should type in something before it continues.
Anyway, here is my program:
Code:#include <iostream> #include <fstream> using namespace std; int main() { string text; int choice; int finish = 0; cout<<"###### ######'s bibliography writing program\n"; cout<<"A html file will be written containing your bibliography.\n"; ofstream page("bibliography.html"); page<<"<html><body><h1><b><u><marquee behavior = 'alternate'>###### ######'s bibliography writing program!!</marquee></u></b></h1>\n"; while (finish == 0 && finish != 1) { page<<"<br>"; cout<<"MENU:\ntype in the number next to want you want to do\n1. Add a book to your bibliography\n2. finish\n"; cin>>choice; if (choice == 1) { cout<<"what is the authors last name?\n"; cin>>text; page<<text<<", "; cout<<"what is the authors initial?\n"; cin>>text; page<<text<<". "; cout<<"what year was it first published in?\n"; cin>>text; page<<"("<<text<<"), "; cout<<"what is the book called?\n"; cin>>text; page<<"<i>"<<text<<"</i>. "; cout<<"where was it published? If your not sure check the back of the book and covers\n"; cin>>text; page<<text<<": "; cout<<"Who is the publisher?\n"; cin>>text; page<<text<<"."; } if (choice == 2) { finish = 1; } } page<<"</body></html>"; page.close(); cout<<"your bibliography is complete, you can now copy and paste or do whatever with the page that has been created\n"; cin.get(); cin.get(); }



LinkBack URL
About LinkBacks


