Results 1 to 15 of 15

Thread: :D

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered 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 .

    :

    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);
    }
    , , , , 1 . while, else ( if...else if, - else), 1,5. . , , " "... 3 , case-a , . , . , . ! !

  2. #2

    Join Date: Apr:2006
    Location:
    Posts: 8,666
    ... , .

  3. #3
    Registered User
    Join Date: Apr:2013
    Location:
    Posts: 151
    , ,

  4. #4
    -==-
    Join Date: Sep:2003
    Location:
    Posts: 6,444
    - case if ... else. do ... while.

    // .

    // /. .
    He who asks is a fool for five minutes, but he who does not ask reamins a fool forever. Old Chinese saying
    Quote Originally Posted by worm4 View Post
    a .

  5. #5
    Registered 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.

  6. #6
    -==-
    Join Date: Sep:2003
    Location:
    Posts: 6,444
    Code:
    if(a=1)
    Code:
    if(a==1)
    ? boolean 3? ?

    . .

    e .

    // case . .
    He who asks is a fool for five minutes, but he who does not ask reamins a fool forever. Old Chinese saying
    Quote Originally Posted by worm4 View Post
    a .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |