Notes
![]() ![]() Notes - notes.io |
{
internal class Program
{
static void Main(string[] args)
{
Notebook notebook = new Notebook("Msi",1,2000,);
notebook.GetFullInfo();
notebook.ShowFullData();
}
}
}
=================================================================================================
namespace ConsoleApp3
{
class Product
{
// Product class:
//==============
//string Name
//string Description
//int Count
//bool IsStock
//double Price (encapsulation)
//Sale() -> satış methodu
public string Name;
public string Description;
public int Count { get; set; }
public bool IsStock;
private double _price;
public Product(string name, int count, double price, string description)
{
Name = name;
Description = description;
Count = count;
if(Count > 0) { IsStock = true; }
_price = price;
}
public double Price
{
get { return _price; }
set
{
if (value > 0 && value < 10000)
{
_price = Price;
}
else
{
Console.WriteLine("Qiymeti duzgun daxil edin!");
}
}
}
public string Sale()
{
if (IsStock)
{
Console.WriteLine("Mehsul satildi!");
Count--;
if(Count == 0)
{
IsStock = false;
}
}
return "Mehsul yoxdur!";
}
}
}
==================================================================
namespace ConsoleApp3
{
class Notebook : Product
{
public int Storage;
private byte _RAM;
public byte RAM {
get { return _RAM; }
set
{
if (value > 0 )
{
_RAM = RAM;
}
else
{
Console.WriteLine("Rami duzgun daxil edin.");
}
}
}
public string GetFullInfo()
{
return new string($"Name: {Name}nCount: {Count}nPrice: {Price}nRAM: {RAM}nStorage: {Storage}nDescription: {Description}");
}
public void ShowFullData()
{
Console.WriteLine(GetFullInfo());
}
public Notebook(string Name, int Count, int Price, byte _RAM, int storage = 128, string Description = "Null") :
base(Name, Count, Price, Description)
{
_RAM = RAM;
Storage = storage;
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team