Share
Explore BrainMass

C++ code for calculating revenue

Define a class called Revenue that has 2 private members of demand and price. Include a constructor and a public function that calculates the RevenueValue of the class. RevenueValue = demand * price
Use public functions of the class in a program that computes RevenueValue and displays RevenueValue when demand is 2000 and price is 2.

Solution Preview

#include<iostream>
using namespace std;

class Revenue {
private:
int demand;
int ...

Solution Summary

The solution gives a complete C++ code for calculating revenue that has 2 private members of demand and price.

$2.19