barnabe0057 icon

TP Distributeur - Boisson.cs

barnabe0057 | PRO | 02/23/22 08:54:44 AM UTC | 0 ⭐ | 951 👁️ | Never ⏰ | []
C# |

1.49 KB

|

None

|

0 👍

/

0 👎

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace MNS
{
    internal class Boisson
    {
        int quantite;
        string nom;
        int sucre;
        bool lait;
 
        //constructeur
        public Boisson()
        {
            quantite = 0;
            nom = "";
            sucre = 0;
            lait = false;
        }
 
        public Boisson(int initQuantite, string initNom, int initSucre, bool initLait)
        {
            quantite = initQuantite;
            nom = initNom;
            sucre = initSucre;
            lait = initLait;
        }
 
        public void Boire(int quantiteABoire)
        {
            quantite -= quantiteABoire;
        }
 
        public int GetQuantite()
        {
            return quantite;
        }
 
        public void SetQuantite(int newQuantite)
        {
            quantite = newQuantite;
        }
 
        public string GetNom()
        {
            return nom;
        }
 
        public void SetNom(string newNom)
        {
            nom = newNom;
        }
 
        public int GetSucre()
        {
            return sucre;
        }
 
        public void SetSucre(int newSucre)
        {
            sucre = newSucre;
        }
 
        public bool GetLait()
        {
            return lait;
        }
 
        public void SetLait(bool newLait)
        {
            lait = newLait;
        }
    }
}
 

Comments