Advertisement
slemiba

L01-08-Pizza egységár

Sep 6th, 2022 (edited)
1,127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 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("--- 8. feladat ---");
  14.             Console.WriteLine("Kérem a 32 cm-es pizza árát!");
  15.             int P32Ar = int.Parse(Console.ReadLine());
  16.  
  17.             Console.WriteLine("Kérem a 45 cm-es pizza árát!");
  18.             int P45Ar = int.Parse(Console.ReadLine());
  19.  
  20.             double P32EAr = P32Ar / (16 * 16 * 3.14);
  21.             double P45EAr = P45Ar / (22.5 * 22.5 * 3.14);
  22.             Console.WriteLine("A 32 cm-es pizza egység ára: " + P32EAr);
  23.             Console.WriteLine("A 45 cm-es pizza egység ára: " + P45EAr);
  24.  
  25.             bool Kjobb = P32EAr < P45EAr;
  26.             bool Njobb = P45EAr < P32EAr;
  27.  
  28.             Console.WriteLine("Jobb-e a 32 centis? " + Kjobb);
  29.             Console.WriteLine("Jobb-e a 45 centis? " + Njobb);
  30.  
  31.         }
  32.     }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement