You are viewing a single comment's thread. Return to all comments →
Please can you help me on this, I cant seem to round my answer. I tried putting plus one the totalCost but I fail the last test case.
using System; using System.Collections.Generic; using System.IO; using System.Linq;
class Solution { public static void Main() { double mealCost; double tipPercent; double taxPercent;
mealCost = Double.Parse(Console.ReadLine()); tipPercent = Double.Parse(Console.ReadLine()); taxPercent = Double.Parse(Console.ReadLine()); int tip = (int) mealCost * (int) tipPercent / 100; double tax = (int) mealCost * (int) taxPercent / 100; double totalCost = (int) mealCost + tax + tip; Console.WriteLine("The total meal cost is {0} dollars.",totalCost); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
Please can you help me on this, I cant seem to round my answer. I tried putting plus one the totalCost but I fail the last test case.
using System; using System.Collections.Generic; using System.IO; using System.Linq;
class Solution { public static void Main() { double mealCost; double tipPercent; double taxPercent;