Program of libarary , C/C++ Programming

using namespace std;
class Book

string title;
int iD;
int year_pub;
string author;
string getTitle();
int getId();
int getYear_Pub();
string getAuthor();
void set(string,int,int,string);
void Book::set(string title,int iD,int year_pub,string author)
this -> title = title;
this -> iD = iD;
this -> year_pub = year_pub;
this -> author = author;
string Book ::getTitle()
return title;
int Book ::getId()
return iD;
int Book ::getYear_Pub()
return year_pub;
string Book ::getAuthor()
return author;
int main()

Book A,B,C;
int pick, year;

A.set("C++ Plus Data Structures:5th Edition",101,2013,"Nell Dale");
B.set("Starting out with C++: From Control Structures through Objects",102,1996,"Tony Gaddis");
C.set("C++ How to Program",103,2007,"Paul and Harvey Deitel");

cout<< "Welcome to Book Search"<do
cout< cout<<"Enter 1 to see all books."< cout<<"Enter 2 to search a book by the Year."< cout<<"Enter 3 to exit this program."< cout<<"Enter a number: "< cin >> pick;


case 1:
cout< cout<<"There is 3 books here:"< cout<
cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< cout<
cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< cout<
cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< break;
case 2:
cout<<"Please enter the year you would like to search"< cin >>year;
if (year==A.getYear_Pub())

cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< cout< }

else if (year==B.getYear_Pub())
cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< cout< }
else if(year==C.getYear_Pub())
cout<<"Title:"< cout<<"ID:"< cout<<"Year:"< cout<<"Author:"< cout< }
cout<<"There is no book by that year."<

case 3:
cout<<"End of program."<

cout<<"Not a valid number.\n"
<<"Enter again."< }
while(pick !=3);

return 0;


Posted Date: 3/30/2013 1:58:19 AM | Location : United States

Related Discussions:- Program of libarary , Assignment Help, Ask Question on Program of libarary , Get Answer, Expert's Help, Program of libarary Discussions

Write discussion on Program of libarary
Your posts are moderated
Related Questions
Described the ISA and HASA class relationships. How would you apply each in a class design? A: A specialized class "is" specialization of another class and, thus, has the ISA re

I need vsti program Project Description: Knowledge of vsti programs, and music is a plus, ex: nexus I will input the sounds I just need the interface built Skills required

A: This is a name that acts as an alias, or alternative name, for a beforehand defined variable or an object. prepending variable along with "&" symbol makes it as reference. fo

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

WAP TO PRINT SERIES FROM 1 TO 10 & FIND ITS SQUARE AND CUBE # include stdio.h> # include conio.h> # include math.h>   void main () { int a=1,sqr=0,cube=0;

Problem : Luminous Jewels - Polishing Necklace Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of v

Function Templates Function templates give you with the capability to write a one function that is a skeleton, or template, for a family of similar functions. In function ov

overload assignment opertor to assign the data of one object to anthor

write a javaprogram to solve padovan string using java? program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring;

Object Initialization An object of a derived class can be initialized to an object of a base class. If both the classes have similar data members, then no specific constructor