I am writing a program called Pricing Optimiser. I would like based on the capacity (100, 200 or 300) given by the user and the number of seats sold suggest the optimal price. I will do it with the hep of Excel Database. Here is the code. The part I am missing I wrote as a text.
#include <iostream>
#include <fstream>//to work with files
using namespace std;
int main()
{
float capacity; //number of seats in plane/bus/train/stadium/concert hall/
number of beds in a hotel
float capacitysold;//number of seats/beds sold
cout << "State capacity 100 or 200 or 300:";
cin >> capacity; //console input capacity
cout << "State capacity sold:";
cin >> capacitysold; //console input capacity
//based on the capacity and capacitysold entered data by the user show me
from the Excel list the suggested price, please help me to write here a
suitable code
system("PAUSE");
Here is the example of the Excel Data. Data is organized in excel in 3 columns (capacity, number of seats and price). Capacity will be 100, 200 or 300. Price increases with the number of seats sold and the row number of seats sold from 1 to max capacity
Capacity Number of seats Price (EUR)
100 1 20
100 2 20
100 3 20
100 4 20
100 5 20
100 6 20
100 7 20
100 8 20
100 9 20
100 10 20
100 11 20
100 12 20
100 13 20
100 14 20
100 15 20
100 16 20
100 17 20
100 18 20
100 19 20
100 20 20
100 21 30
100 22 30
100 23 30
100 24 30
100 25 30
100 26 30
100 27 30
100 28 30
100 29 30
100 30 30
100 31 30
100 32 30
100 33 30
100 34 30
100 35 30
100 36 30
100 37 30
100 38 30
100 39 30
100 40 30
100 41 50
100 42 50
100 43 50
100 44 50
100 45 50
100 46 50
100 47 50
100 48 50
100 49 50
100 50 50
100 51 70
The data goes until 100 and the price is increased, the same below it is written for 200 and 300.
So for example if sb enters capacity 100 and number of seats sold 51 the suggested price will be 70. How to incorporate it to my C++ program?