vrbb / TheatreCompany-Calculation

Software that calculates the value of theatre play based on the audience.
0 stars 0 forks source link

Value calculation #2

Open vrbb opened 2 years ago

vrbb commented 2 years ago

Create function to calculate the value of a play from a JSON. Example:

[
  {
     "costumer" : "BigCo",
     "performaces" : [
       {
         "playID" : "hamelet",
          "audience" : "55",
        },
        {
          "playID" : "as-like",
          "audience" : "35",
        },
        {
          "playID" : "othello",
          "audience" : "40",
        },
    ]
  }
]
vrbb commented 2 years ago

Using the formula:

(audience * 1000) / type_play

where:

{
    "type_play" : {
        "tragedy" : 40,
        "comedy" : 60
    }
}