Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- const int kopInGrn{ 100 };
- const int secInMin{ 60 };
- double minuteCostGrn{1};
- int callTimeMin{ 1 };
- int callTimeSec{ 30 };
- std::cout << "Enter call cost per minute in Grn\n";
- std::cin >> minuteCostGrn;
- std::cout << "Enter call duration, minutes\n";
- std::cin >> callTimeMin;
- std::cout << "Enter call duration, seconds\n";
- std::cin >> callTimeSec;
- double callCostTotal = (callTimeMin + callTimeSec / (double)secInMin) * minuteCostGrn;
- std::cout << "Total call cost: " << (int)callCostTotal << " grn. " << (int)(callCostTotal * kopInGrn) % kopInGrn << " kop\n";
- }
Add Comment
Please, Sign In to add comment