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
For the circuit shown in Figure, verify (a) the battery voltage V , (b) the total resistance of the circuit, and (c) the values of resistance of resistors R 1 , R 2 and

What are the debugging methods you employ while came across a problem? A: Debugging with tools such as: 1.      DBG, GDB ,Forte, Visual Studio. 2.      Using tusc to trace

Define Advantages of Multi File Program? The main merits of spreading a program across several files are: • Teams of programmers able to work on programs. Every programmer w

how would land elevation have changed if Coronado had traveled 150 miles due west from what is today Arizona instead of east toward New Mexico

Public derivation Public derivations are much more common than private derivations. In this situation: The private members inherited from the base class are inaccessible

Binomial coefficients are the numeric factors of the products in a power of a binomial such as (x + y)n. For example, (x + y)2 = x2 + 2 x y + y2 has the coefficients 1 2 1. Binomia

When declaring a variable of data type pointer, use the * in front of the variable name. These variables hold a memory location (like B45CDF), not an actual value like 30 or A:

Project Description: Design and prepare software that can navigate a mobile robot using SLAM technique using vision sensor (camera). Skills required are C Programming, Engine

how to convert a general tree into binary tree with example

Describe the “placement new" and why would I use it?