dsavov_02

Game

Apr 6th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 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 ConsoleApp18
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Game game = new Game("Shooter", "multiplayer", 50);
  14.             Game game1 = new Game("Strategy", "multiplayer", 40);
  15.             MaxPrice(game, game1);
  16.         }
  17.  
  18.         static void  MaxPrice(Game game1 ,Game game)
  19.         {
  20.  
  21.             Console.WriteLine(Math.Max(game.price, game1.price));
  22.         }
  23.  
  24.     }
  25. }
  26. class Game
  27. {
  28.     public string kind;
  29.     public string multiplayer;
  30.     public double price;
  31.     public Game(string kind, string multiplayer,double price)
  32.     {
  33.         this.kind = kind;
  34.         this.multiplayer = multiplayer;
  35.         this.price = price;
  36.     }
  37. }
Add Comment
Please, Sign In to add comment