Computer Science, asked by ayeshajung5, 5 months ago

Define a class called Bookorder
Instance variable :
String title: To store title of the book
double weight : To store weight of the book
double cost : To store cost one book
double totalbooks : To store total numbered of books order
Methods()
Bookorder() : Default constructor to initialize data members to default values void input() : To input all related values
void calculate() : Find total weight and total cost
total weight ; total books * weight;
total cost = total books * weight;
total cost = total books * cost;
Write main method and call all above member method.


Spammers will be reported.

Answers

Answered by Kaushikkalesh
1

#include <iostream>

using namespace std;

class Bookorder {

private:

string title; double weight; double cost; double totalbooks;

public:

Bookorder() {

//

}

void input() {

cin >> title >> weight >> cost >> totalbooks;

}

void calculate() {

cout << totalbooks*weight << endl;

cout << totalbooks*cost;

}

};

int main() {

Bookorder obj;

obj.input();

obj.calculate();

}

Answered by Anonymous
5

Answer:

........,........,......

Similar questions