Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpDemo
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Read the input
- double inputCount = double.Parse(Console.ReadLine());
- string fromMetric = Console.ReadLine();
- string toMetric = Console.ReadLine();
- //Declare two additional variables to store current calculations
- double middleValue = 0; // -> Store middle value here
- double totalValue = 0; // -> Store total value here
- // Calculate middleValue
- if (fromMetric == "mm")
- {
- middleValue = inputCount / 1000;
- }
- //TO DO -> Calculate all the possible cases of input metric so you can always store the correct middle value
- //
- //
- //Check and calculate middle to total Value
- if (toMetric == "mm")
- {
- totalValue = middleValue * 1000;
- }
- //TO DO -> calculate the total value for all the possible output metrics
- Console.WriteLine($"{totalValue:f8}"); //-> Print the result
- //In order to solve the problem you have to complete all "TO DO" cases -> use if() and else if() conditional statements
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment