//Program to collect and hold data on CD's
#include <iostream>
#include <fstream>
using std::cout;
using std::cin;
using std::endl;
using std::ifstream;
int main() {
int QA;
cout << "To veiw file press v, to add a new CD press a:\n";
cin.get(QA);
if (QA == v) {
while (CDs.get(ch)) cout.put(ch);
}
if (QA == a) {
int bn;
int an;
cout << "Enter Band Name:";
cin.get(bn);
cout << endl;
ifstream CDs ("CDs.txt" ios::in);
if (CDs.is_open() ) {
CDs << bn << endl;
CDs.close();
}
cout << "Enter Album Name:";
cin.get (an);
cout < endl;
ifstream CDs ("CDs.txt" iost::in);
if (CDs.is_open() ) {
CDs << an << endl;
CDs.close();
}
while (CDs.get(ch)) cout.put(ch);
cin.get();
return 0;
}
Ok, this is a program meant to store and alow you to see the CD's. First it ask's if you want to Veiw the CD's for Add a new CD. If you choose veiw, it shows them, if you choose add new it asks for the band name, then adds it to the file, then asks for the album name and adds it to. I dont understand how i even wrote this, and its giving me ALOT of errors. Any ideas whats wrong?