Pages

3/17/2016

C++ Program For Store Book Details Using Structure

Problem:- Write A C++ Program For Store Book Details Using Structure or c++ program for book details using structure or c++ program for book inventory or student record program using structure in c++ or c++ program using structure for student database or c++ program for student details using class or c++ program for student details using array of objects or student mark list program in c++ using files.Note:- Please See This is A Requested Problem From Ethiopia. You Can Also Request Any Problem Regarding Programming. So Don't Forgot To Share Thanks, Tomas Umer (Ethiopia)Writing For Us."Question:- a c++ program using a structure which accepts information on five books. The information includes titles, publication year, and status.what the status will do is if the book is published before 1990 it says "outdated" if the book is published between 1991-2000 the status will be "medium" but it's after 2000 the status will be "lates" please help me thank u "

What Is Structure The structure is a user-defined data type in C++. The structure is used to represent a record. Suppose you want to store a record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information.Defining a structurestruct keyword is used to define a structure. struct define a new data type which is a collection of different type of data.Syntax:-struct structure_name{//Statements};Logic:- Here we are storing a book's information like Title, Publication. here in the structure block book title and publication define a string and year and status is an integer. see the below block for better understanding.Structure Blockstruct books{ char title[25]; char pub[25]; int year; int status;};After the defined structure put the value in the structure by putting the value taking from a user with the help of ' For Loop '. first enter book title after that book publication then after a year and at the last status of the book. See the Example how Store the info in structure for(i=0;i<n;i++){cout<<"Title : ";cin>>a[i].title;cout<<"Publication : ";cin>>a[i].pub;cout<<"Year : ";cin>>a[i].year;cout<<"Status : ";cin>>a[i].status;cout<<"----------------------\n"; }And at the end display or print, the structure Stored Information to console.for(i=0;i<n;i++) {cout<<"\n"<<a[i].title<<"\t\t|"<<a[i].pub<<"\t\t|"<<a[i].year<<"\t\t|";if(a[i].status <=1990){cout<<"Outdated";}else if(a[i].status >= 1991 && a[i].status <=2000){cout<<"Medium";}else{cout<<"Lates";} }Tip:- See The Below Problem For Handling a Nested Structure and If you have any query or suggestion feel free to share with me, I will help you.Try ThisC++ Program For Employee Information Using Nested Structure

3 comments:

please answer my questions by today(c++)Q1. Write a menu driven program to store the details of books using structure and do the following : struct book { int bcode, price; char title[15];

};• A function to store the book details.• A function to display the details from high priced books to low priced books of a type requested by the user.• A function to display the details of book (bcode) requested by the user.• A function to display details of all books.

Q3. Write a menu driven program to store the details of flight using structure and do the following : struct flight { int fcode, fare ; char name[15]; };• A function to store the flight details.• A function to display the details from highest fare to least fare.• A function to display the details of flight (fcode) requested by user.• A function to display details of all flight.

Q5. Write a menu driven program to store the details of account holders using structure and do the following : struct account { int accno, balance ; char name[15]; };• A function to store the account details.• A function to display the details in ascending order of balance.• A function to display the details of account holder (accno) requested by user.• A function to display details of all account holders.

Q1. Write a menu driven program to store the details of books using structure and do the following : struct book { int bcode, price; char title[15];

};• A function to store the book details.• A function to display the details from high priced books to low priced books of a type requested by the user.• A function to display the details of book (bcode) requested by the user.• A function to display details of all books.

Q2. Write a menu driven program to store the details of books using structure and do the following : struct book { int bcode, price; char name[15]; };• A function to store the book details.• A function to display the details from low priced books to high priced books.• A function to display the details of book name requested by user.• A function to display details of all books.

Q3. Write a menu driven program to store the details of flight using structure and do the following : struct flight { int fcode, fare ; char name[15]; };• A function to store the flight details.• A function to display the details from highest fare to least fare.• A function to display the details of flight (fcode) requested by user.• A function to display details of all flight.

Q4. Write a menu driven program to store the details of flight using structure and do the following : struct flight { int fcode, fare ; char name[15]; };• A function to store the flight details.• A function to display the details from least fare to highest fare.• A function to display the details of flight name requested by user .• A function to display details of all flight.

Q5. Write a menu driven program to store the details of account holders using structure and do the following : struct account { int accno, balance ; char name[15]; };• A function to store the account details.• A function to display the details in ascending order of balance.• A function to display the details of account holder (accno) requested by user.• A function to display details of all account holders.