Answer to Question #206706 in C++ for SWB

Question #206706

Create a software that has multiple features to handle books management. Book shop have 100 books for customers. The shop gives book on rent and charge per day according to type of book. Write a main function that will display these options 1. Rent a Book 2.Calculate total amount of all currently Rented Books 3 .Exit the program. Ask Repeatedly by showing menu unless user exit program Create Structure to store this data for each book I.e (for 100 books) Book Id, Book name, Customer name, Type of book (Novel=2000, Academic=1500, Philosophy=2000, Islamic=1000) , No of days. Create a Structure array of Books for 100 Books data. Program should calculate total fee of all rented books in shop currently to keep. You need to firstly calculate fee for each book separately by checking their days and then finally you have to calculate all amount of currently rented books. As well as show customer name of book who have payed most amount. Finally get count of available book along with type and display.



1
Expert's answer
2021-06-14T04:58:35-0400
#include <iostream>
#include <string>


struct book {
    unsigned long long int id;
    std::string name;
    std::string customer;
    std::string type;
    int days;
};


void menu()
{
    std::cout << "1) Rent a Book" << std::endl;
    std::cout << "2) Calculate total amount of akk currency Rented Books" << std::endl;
    std::cout << "3) Exit the program" << std::endl;
}


struct book[100];


void rent() // implementation
{
}


void calculate() // implementation
{
}


int main()
{
    while ( true ) {
        menu();
        int choise;
        std::cin >> choise;
        switch ( choise ) {
            case 1:
                rent();
                break;
            case 2:
                calculate();
                break;
            case 3:
                break;
            default:
                std::cout << "oops.." << std::endl;
        }
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog