We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

#include <iostream>#include <iostream>#include <stdlib.h>#include <string.h>
using namespace std;// struct define here struct student{ int bookID; char title[50]; char authorofBook[50]; int costofBook;};
// initialize books with 5 numberconst int noofBooks = 5;int arrindex = 0;
// create object of student which is struct student studentobj[noofBooks];
// add books function herevoid Add_Book(){ if(arrindex < noofBooks){ cout "***Enter the Details of Books***"endl; cout "Enter a book id"; cin >> studentobj[arrindex].bookID; cout "Enter book Title"; cin >> studentobj[arrindex].title; cout "Enter the name of author"; cin >> studentobj[arrindex].authorofBook; cout "Enter the cost of Book"; cin >> studentobj[arrindex].costofBook; arrindex++;}else{ cout "No more space in system for another book";} }
// display books functions herevoid Display_Books(){ for(int i = 0; i < arrindex; i++){ cout "***Details of all books in library ***"endl; cout "book id " studentobj[i].bookID endl; cout "Book Title is " studentobj[i].title endl; cout "Author name " studentobj[i].authorofBook endl; cout "Cost of Book" studentobj[i].costofBook endl; }
}
// search books by author name function here void Book_Author(){ char search_book[30]; cout "Enter the name of  Author: " endl; cin >> search_book; for(int i = 0; i < arrindex; i++){ if(strstr(search_book,studentobj[i].authorofBook)){ cout endl; cout "Book id is : " studentobj[i].bookID endl; cout "Book Title is :" studentobj[i].title endl; cout "Author Name is " studentobj[i].authorofBookendl; cout "Cost of Books :"studentobj[i].costofBookendl; }else{ cout "No Record Found"endl; } }}
// here is main programint main(){ int choice; char input; do{ cout "***Library Book Record  System***" endl; cout "Press 1 To Enter a Book Record"endl; cout "Press 2 To Display All Records of Books available in library"endl; cout "Press 3 To Search Books by Author Name"endl; cout "Press 4 To Count Total Books in Library"endl; cout "Press 5 To Exit from the System"endl; cout "Enter the Choice"endl; cin >> choice; switch(choice){ case 1: Add_Book(); break; case 2: Display_Books(); break; case 3: Book_Author(); break; case 4: cout "Total number of books in library are :" arrindex endl; break; case 5: exit(0); default: cout "invalid Choice Please try again!"; } cout "Are you want to continue, Please press y or  Y"endl; cin >> input;
}while(input=='Y' || input == 'y'); }

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 185

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Latest Activity

BIA posted discussions
7 minutes ago
+ !! SARAH liked BIA's discussion Aurat ko khelona smjhny waly. . . . .
8 minutes ago
+ !! SARAH liked BIA's discussion Ehsaas...
8 minutes ago
+ !! SARAH replied to BIA's discussion Ehsaas...
8 minutes ago
+ !! SARAH posted discussions
12 minutes ago
+ !! SARAH replied to + Iuuoɔǝut+'s discussion Mind blowing mehndi design ...
16 minutes ago
+ !! SARAH liked + Iuuoɔǝut+'s discussion Mind blowing mehndi design ...
25 minutes ago
+ !! SARAH liked + Iuuoɔǝut+'s discussion دولت کی اہمیت۔۔۔۔۔۔
25 minutes ago
+ !! SARAH liked + Iuuoɔǝut+'s discussion آپ کی آنکھیں وہی کھولتے ہیں۔۔۔۔۔۔۔۔
25 minutes ago
+ !! SARAH liked + Iuuoɔǝut+'s discussion جیسے جیسے پڑھتے گئے۔۔۔۔۔۔۔ڈوپٹے۔۔۔۔
25 minutes ago
BIA liked + ! ✨ ░S░I░N░G░E░R's discussion Competitions on Anti-Corruption Awareness, 2019
29 minutes ago
+ !! SARAH liked + ! ✨ ░S░I░N░G░E░R's discussion Competitions on Anti-Corruption Awareness, 2019
30 minutes ago
+ !! SARAH liked + ! ✨ ░S░I░N░G░E░R's discussion Issuance of First Voucher to Continuing Students (Fall, 2019)
30 minutes ago
BIA liked BIA's discussion Zuban Bhe Milta Hai.. :P:P
30 minutes ago
BIA liked BIA's discussion Al Quran. <3
30 minutes ago
BIA liked BIA's discussion Surat Ale Imran 3:150
30 minutes ago
BIA liked BIA's discussion QURAN 9:38
30 minutes ago
BIA liked BIA's discussion Who is ALLAH.?
30 minutes ago
+ !! SARAH liked + !! SARAH's discussion hahhahahahaha!!!!!!
31 minutes ago
+ !! SARAH replied to + !! SARAH's discussion hahhahahahaha!!!!!!
32 minutes ago

Today Top Members 

© 2019   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service