Advertisement
slemiba

L01-07-Fogyasztás

Sep 6th, 2022 (edited)
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp7
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("--- 7. feladat ---");
  14.             Console.WriteLine("Kérem a tank méretét:");
  15.             double tank = double.Parse(Console.ReadLine());
  16.  
  17.  
  18.             Console.WriteLine("Kérem az átlagfogyasztást:");
  19.             double atlag = double.Parse(Console.ReadLine());
  20.  
  21.             double km = tank / atlag * 100;
  22.  
  23.             Console.WriteLine("A várható hatótáv: " + km + " km.");
  24.            
  25.             Console.WriteLine("Ez mérföldben: " + (km * 0.62137) + " mi. ");
  26.         }
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement