Advertisement
Guest User

tennis

a guest
Jan 13th, 2020
513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double priceOneTennisRacket;
  9.     int numberTennisRacket, numberShoes;
  10.  
  11.     cin >> priceOneTennisRacket >> numberTennisRacket >> numberShoes;
  12.  
  13.     double priceAllRackets = priceOneTennisRacket * numberTennisRacket;
  14.  
  15.     double priceShoes = priceOneTennisRacket / 6;
  16.     double allShoes = priceShoes * numberShoes;
  17.     double otherЕquipment = (allShoes + priceAllRackets) * 0.2;
  18.     double totalPrice = priceAllRackets + allShoes + otherЕquipment;
  19.     double priceForDjoko = totalPrice / 8;
  20.     double priceForSponsor = (totalPrice * 7) / 8;
  21.  
  22.     cout << "Price to be paid by Djokovic " << floor(priceForDjoko) << endl;
  23.     cout << "Price to be paid by sponsors " << ceil(priceForSponsor) << endl;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement