Question
You don't have to fix my code if you don't want to. Solving this assignment originally would be even more helpful, I'll adjust my own
You don't have to fix my code if you don't want to. Solving this assignment originally would be even more helpful, I'll adjust my own work to reflect your solution.
(Nobody answered the first time this was posted)
Due at the beginning of class. Hand in hard copy of your code and be prepared to run your program. Develop your program as follows: The main program and each class definition must be in separate files. Ensure your code conforms to your Style Guide. Part 1 Copies of Books The library has multiple copies of each book. Track the number of copies of each book, and track one borrower for each copy. Do not allow book check out if all copies are already checked out. Part 2 Publication Class In your Library Lab, rename Book to Publication wherever it appears. Test your program to ensure it works properly. Part 3 Book, Music, and Video classes Add a new Book class, as well as Music and Video classes. All three classes are derived from the Publication class. Add these member variables: Book class: pages format (hardcover, softcover, digital) Music class: duration (seconds) format (MP3, AAV, WAV) Video class: resolution (low, high, 4K) producer Add constructors, get functions, and set functions as needed. Part 4 Overdue Publications Write a Date class with member variables year, month, and day, and member functions as needed. Add an overloaded - operator, which calculates days between two Date objects. Publications may be checked out for 21 days. In your main program, add a menu option to enter todays date. When a Publication is checked out, save todays date. When a Publication is checked in, indicate if it is overdue and tell subscriber to pay a fine of 5 cents per day.
Totally lost, this is what I have so far:
#ifndef libtest_h #define libtest_h #include
#include
Book books[SIZEBOOKS]; books[0].bookarrayconstructor(69, "Softcover","Captain Underpants", "Dav Pilkey", 1, 9); books[1].bookarrayconstructor(143, "Softcover","Goosebumps", "R. L. Stine", 2, 5); books[2].bookarrayconstructor(304, "Hardcopy", "Animorphs", "K. A. Applegate", 3, 1); books[3].bookarrayconstructor(510, "Hardcopy", "Spiderman", "Stan Lee", 4, 4);
Music mus[SIZEMUS]; mus[0].musicarrayconstructor(6.43, "MP4", " ", " ", 1, 4); mus[1].musicarrayconstructor(0.21, "MP3", " ", " ", 2, 3); mus[2].musicarrayconstructor(3.10, "MP3", " ", " ", 3, 2); mus[3].musicarrayconstructor(597325.12, "MP3", " ", " ", 4, 8);
Video vid[SIZEVID]; vid[0].vidarrayconstructor(7680, "The Wayans Brothers", "Don't Be a Menace to South Central While Drinking Your Juice in the Hood", " ", 1, 7); vid[1].vidarrayconstructor(144, "George Lucas", "Starwars", " ", 2, 4); vid[2].vidarrayconstructor(2048, "Dave Chappelle", "The Chappelle Show", " ", 3, 5); vid[3].vidarrayconstructor(1080, "Stan Lee", "Venom", " ", 4, 6);
do{ d1.setzero(d1,d2); cout<< "What do you want to do? "; cout << "1) See people's names and what they have checked out "; cout << "2) See the items and who has them checked out "; cout << "3) Check out an item(s) "; cout << "4) Check in an item(s) "; cout << "0) To exit "; cin >> num; if (num==1) { for (int i=0; i if (num==2) { do { cout << "Which item would you like to view? "; cout << "1) Books "; cout << "2) Videos "; cout << "3) Music "; cout << "0) Exit "; cin >> inum; if (inum==1) { for (int i=0; i if (inum==2) { for (int i=0; i if (num==3) { cout << "What do you want to check out? Enter 'B' for book, 'V' for video, or 'M' for music. "; cin >> choice; switch (choice) { case 'b': case 'B': cout << "Which book would you like to check out? Enter the ID number of it. "; cin >> num2; num2-=1; if (Book::bookborrow[num2][Publication::count2]>books[num2].pub.copies) { cout << "All copies of this book are checked out. "; } else{ cout << "Who's checking out this book? Enter their ID number. "; cin >> num3; num3-=1; books[num2].pub.checkout(ppl[num3],num2,type[0]); d1.displaydueout(d1, d2); } break; case 'v': case 'V': cout << "Which video would you like to check out? Enter the ID number of it. "; cin >> num2; num2-=1; if (Video::vidborrow[num2][Publication::count2]>vid[num2].pub.copies) { cout << "All copies of this video are checked out. "; } else{ cout << "Who's checking out this video? Enter their ID number. "; cin >> num3; num3-=1; vid[num2].pub.checkout(ppl[num3],num2,type[1]); d1.displaydueout(d1, d2); } break; case 'm': case 'M': cout << "Which song would you like to check out? Enter the ID number of it. "; cin >> num2; num2-=1; if (Music::musborrow[num2][Publication::count2]>mus[num2].pub.copies) { cout << "All copies of this album are checked out. "; } else{ cout << "Who's checking out this album? Enter their ID number. "; cin >> num3; num3-=1; mus[num2].pub.checkout(ppl[num3],num2,type[2]); d1.displaydueout(d1, d2); } break; default: cout << "You entered an invalid character. "; break; } } if (num==4) { cout << "What do you want to check in? Enter 'B' for book, 'V' for video, or 'M' for music. "; cin >> choice; switch (choice) { case 'b': case 'B': cout << "Which book would you like to check in? Enter the ID number of it. "; cin >> num2; num2-=1; if (Book::bookborrow[num2][Publication::count2]<=0) { cout << "All copies of this book are already checked in! "; } else{ cout << "Who's checking in this book? Enter their ID number. "; cin >> num3; books[num2].pub.checkin(ppl[num3],num2,type[0]); d1.displaydatein(d1, d2); } break; case 'v': case 'V': cout << "Which video would you like to check in? Enter the ID number of it. "; cin >> num2; num2-=1; if (Video::vidborrow[num2][Publication::count2]<=0) { cout << "All copies of this video are already checked in! "; } else{ cout << "Who's checking in this video? Enter their ID number. "; cin >> num3; vid[num2].pub.checkin(ppl[num3],num2,type[1]); d1.displaydatein(d1, d2); } break; case 'm': case 'M': cout << "Which song would you like to check in? Enter the ID number of it. "; cin >> num2; num2-=1; if (Music::musborrow[num2][Publication::count2]<=0) { cout << "All copies of this album are already checked in! "; } else{ cout << "Who's checking in this album? Enter their ID number. "; cin >> num3; mus[num2].pub.checkin(ppl[num3],num2,type[2]); d1.displaydatein(d1, d2); } break; default: cout << "You entered an invalid character. "; break; } } }while(num!=0); return 0; } /*void deletebooks(Book books, int num){ bool bye[books.pub.copies]; for (int i=0; i */
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started