Foibs

tainies me constructor, klaseis kai methodous

Dec 12th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp2
  4. {
  5.     class tainies
  6.     {
  7.         private double charge = 1.5;
  8.         private double perDay;
  9.         private int code, duration;
  10.         private string title, category;
  11.         public tainies(int inCode, int inDuration, string inTitle, string inCategory, double inPerDay)
  12.         {
  13.             code = inCode;
  14.             duration = inDuration;
  15.             title = inTitle;
  16.             category = inCategory;
  17.             perDay = inPerDay;
  18.         }
  19.         public tainies()
  20.         {
  21.             code = 0;
  22.             duration = 0;
  23.             title = "";
  24.             category = "";
  25.             perDay = 0;
  26.         }
  27.         public double cost(int days)
  28.         {
  29.             return charge + (days * perDay);
  30.         }
  31.         public void showMovie()
  32.         {
  33.             Console.WriteLine("Code: " + code + "Duration: " + duration + "Title: " + "Category: " + category);
  34.         }
  35.         public void changeCharge(int n)
  36.         {
  37.             charge = n;
  38.         }
  39.     }
  40.     class Program
  41.     {
  42.         static void Main(string[] args)
  43.         {
  44.  
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment