Program of libarary , C/C++ Programming

#include
#include
using namespace std;
class Book

{
private:
string title;
int iD;
int year_pub;
string author;
public:
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;

switch(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< }
else
cout<<"There is no book by that year."<

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

break;
default:
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
Given an integer n and a permutation of numbers 1, 2 ... , n-1, n write a program to print the permutation that lexicographically precedes the given input permutation. If the given

Project Description: P2P media streaming browser (IE, Chrome, Firefox) plug-in needed that is compatible with Win Xp,7,8 that is Windows Firewall friendly Example like Swarm

Your task is to create a programming system for a ferry. The ferry transports passengers and vehicles (cars, busses, lorries and bicycles). The ferry has space for 200 passengers a

Write a C program to calculate the output Y for a given value of X for the following formula   Y=X 2 + 2X +3   #include stdio.h   void main()   {   char promt;   float y,x


direction[] = {L,R,R,L,L,R,R,R,R,L,Z} length[]= {2,2,1,1,1,2,5,2,2,3,1}

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:

Increment and Decrement Operators.   The operator for increment is '++' and decrement is '-'. These operators enhances or decrease the value of a variable on which they are ope

A: you can exploit by overloading standard operators on a class, the intuition of the users of that class. This allow users program in the language of the problem domain instead of

Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i