/*Copyright ElohimTov LLC*/ /* //Name: ElohimTov Solve Code - Operators - C# Solution //Problem: HackerRank - 30 Days of Code - Operators //Current File: ElohimTovSolve_Operators.(cs).txt //Compile-able File: ElohimTovSolve_Operators.cs //Date: 02/12/2019 //Tale: ElohimTov Solve's Solution to HackerRank.com's // Operators problem, in C# programming language. // Problem link at https://elohimtov.com/elohimtov.info. */ using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Text.RegularExpressions; using System.Text; using System; class Solution { // Complete the solve function below. static void solve(double meal_cost, int tip_percent, int tax_percent) { int hundred = 100; double tip_amount = (meal_cost * tip_percent)/hundred; double tax_amount = (meal_cost * tax_percent)/hundred; double total_cost = meal_cost + tip_amount + tax_amount; int total_cost_rounded = (int)Math.Round(total_cost); Console.WriteLine(total_cost_rounded); }//ends function solve(...) /* //CREDIT: The following Main() function was provided by HackerRank.com */ static void Main(string[] args) { double meal_cost = Convert.ToDouble(Console.ReadLine()); int tip_percent = Convert.ToInt32(Console.ReadLine()); int tax_percent = Convert.ToInt32(Console.ReadLine()); solve(meal_cost, tip_percent, tax_percent); }//ends function Main(string[] args) }//ends class Solution /*Copyright ElohimTov LLC*/