No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hi, this program is supposed to get data from an input file, have the user add new data, then output the new data in an output file. There are also supposed to be inheritance classes for the different titles. The 2 derived classes should be a fiction one and a … |
|
a)i got stuck with a qustion which asks for a date input in this format: DD-MM-YYYY. I used a string to get the date input because the "-" are required, but then i'm not sure how to check that the user only enters dates. b)another problem i encountered is that … |
|
[code=cplusplus] #include<iostream> #include<cstring> #include<fstream> #include<iomanip> using namespace std; void CREATELIBRARY(); //function to validate creatdate int main() { CREATELIBRARY(); return 0; } void CREATELIBRARY() { ofstream outFile; char creatdate[10]; int bookno,catno,title;//[30] outFile.open("BOOKS.dat"); cout<<"Enter the creation date (MM-DD-YYYY):"<<endl; cin.get(creatdate,20); cin.ignore(80,'\n'); //function to validate creatdate cout<<creatdate<<endl; outFile<<creatdate; cout<<"Enter the number of books:"<<endl; cin>>bookno; … |