MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / solve

Function solve

Hackerrank_problems/Operators/Solution.cpp:5–10  ·  view source on GitHub ↗

Given below is th solve function

Source from the content-addressed store, hash-verified

3
4// Given below is th solve function
5void solve(double meal_cost, int tip_percent, int tax_percent) {
6float tip = (meal_cost*tip_percent)/100; //defining tip = mealcost*tip_percent/100
7float tax = (meal_cost*tax_percent)/100;//defining tax = mealcost*tax_percent/100
8float total = meal_cost + tax + tip;//defining total as sum of meal_cost +tip +tax
9cout<<round(total);//printing round off of total since total is not an integeral value
10}
11
12int main()
13{

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected