Results 1 to 15 of 15
Thread: :D
Hybrid View
-
14th December 2014 20:44 #1Registered User
Join Date: Apr:2013
Location:
Posts: 151
:D
,
. , . :
"" , . (0-200 .) , 1, 2, 5, 10, 20 .
3 , : 1 - 20 ., 2 - 35 ., 5 - 70 , 10 - 120 ., () - I - 1.0; II - 1.2; III - 1.5.
:
1) 3 L, M, N ..
2) ( ) ..
3) 3 .
:
, , , , 1 . while, else ( if...else if, - else), 1,5. . , , " "... 3 , case-a , . , . , . ! !Code:#include <iostream> #include <cmath> using namespace std; void main() { int a, ch; float w, d; double b, c; cout << "\n Vavedete teglo: "; cin >> w; cout << "\n Vavedete zona (ot 1 do 3): "; cin >> a; if (a = 1) b = 1; else if (a = 2) b = 1.2; else if(a = 3) b = 1.5; while (a<1 || a>3) cout << "\n Vavedete zona 1, 2 ili 3"; c = w*b; do{ cout << "\n \t Menu"; cout << "\n 1. Taksa"; cout << "\n 2. exit"; cout << "\n 3. exit"; do { cout << "\n Your choice: "; cin >> ch; } while (ch<1 || ch>3); switch (ch) { case 1: cout << "\n Taksata e = " << c << endl; break; } } while (ch != 3); }
-
14th December 2014 20:56 #2
Join Date: Apr:2006
Location:
Posts: 8,666
... , .
-
14th December 2014 20:57 #3Registered User
Join Date: Apr:2013
Location:
Posts: 151
, ,
-
14th December 2014 21:44 #4-==-
Join Date: Sep:2003
Location:
Posts: 6,444
-
14th December 2014 23:15 #5Registered User
Join Date: Apr:2013
Location:
Posts: 151
@Yasen6275 - ...
case .
?
, .
.. , ,Code:#include <iostream> #include <cmath> using namespace std; void main() { int a, ch, ch2; float w, d; double b, c; cout << "\n Vavedete teglo: "; cin >> w; if (w < 1) { a = 20; } else if (w > 1 && w <= 2) {a = 35; } else if (w > 2 && w <= 5) {a = 70; } else if (w>5&&w<=10) {a = 120; } else { cout << "\n Tegloto na pratkata ne moje da e poveche ot 10 kg.!" << endl; } do{ int m; cout << "\n \t Menu"; cout << "\n 1. Taksa"; cout << "\n 2. exit"; cout << "\n 3. exit"; do { cout << "\n Your choice: "; cin >> ch; } while (ch<1 || ch>3); switch (ch) { case 1: do{ cout << "\n \t Izberete zona"; cout << "\n 1. Zona 1"; cout << "\n 2. Zona 2"; cout << "\n 3. Zona 3"; do { cout << "\n Your choice: "; cin >> ch2; } while (ch2<1 || ch>3); switch (ch2) { case 1: b = 1; c = a*b; cout << "\n Taksata e = " << c << endl; break; case 2: b = 1.2; c = a*b; cout << "\n Taksata e = " << c << endl; break; case 3: b = 1.5; c = a*b; cout << "\n Taksata e = " << c << endl; break; } } while (ch2 != 3); } } while (ch != 3); }
- , , , 3- ...Last edited by DiDk070; 15th December 2014 at 01:18.
-
14th December 2014 23:43 #6-==-
Join Date: Sep:2003
Location:
Posts: 6,444




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in