Dasturlash uslublari va paradigmalari fanidan 4- topshiriq
Topshiriq hisobotida masala sharti, dastur kodi va natijasini joylashtiring. Faylni .pdf formatida yuklang. Topshiriqni bajarish muddati 17.12.2022y kunigacha.
Masala.
2. “kasr” sinfini yarating. Unda kasr sonlar ustida amallar bajarish dasturini tuzing
UML diagramma
kasr
|
int surat1, maxraj1;
int surat2, maxraj2;
|
qisqartir(int surat1, int maxraj1)
qoshish(int surat1, int maxraj1, int surat2, int maxraj2)
kopaytirish(int surat1, int maxraj1, int surat2, int maxraj2)
ayirish(int surat1, int maxraj1, int surat2, int maxraj2)
bulish(int surat1, int maxraj1, int surat2, int maxraj2)
|
Misol uchun:
Kiruvchi malumotlar: 3 4 2 4
Son.qoshish(3, 4, 2, 4)
Chiquvchi ma’lumot: 5/4
Do'stlaringiz bilan baham: |