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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Explain the For Loop - Computer Programming? Similar to the while statement, for loop is an entry controlled loop and the code of the for loop will be executed itereatively. Th

6#666#665533999 where # is used as space.output is monkey

Question 1 Write a program that accepts two numbers from the user and swaps the two numbers without using a temporary variable Question 2 Write a program that accepts a 3x

6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler. Where ‘0’ denotes the "space".

I need to make a fractal trees in OpenGL C++ . The method used is to write a recursive function with cylinders of different sizes and angles to create the tree trunk and branches.

Aim: To implement a program to find area of rectangle, surface area of box and volume of box using virtual functions. Code:                       class rect {

In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, suc

The program sorting.cpp contains a main function for testing the operation of several sort algorithms over various data sizes and data set organisations. The program understands

Project Description: I have a barber salon I am seeking someone to build me software for my PARTNER PT6910 touch screen till system. This software must add multiple staff login