Schemat blokowy

0

Mam takie zadanie. Musze zrobić program liczący pola figur i do niego zrobić schemat blokowy. Program napisałem i chciałbym prosić o pomoc w zrobieniu tego schematu.

oto program:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int i,a,b,h,r; 
    cout << "wybierz figure \n";
    cout << "1 - kwadrat \n";
    cout << "2 - prostokat \n";
    cout << "3 - rownoleglobok \n";
    cout << "4 - romb \n";
    cout << "5 - trapez \n";
    cout << "6 - trojkat \n";
    cout << "7 - kolo \n";
    
    cout << "wybierz calkowita cyfre od 1 do 7 \n";
    cin >> i;
  
 
if(i>7)
{
    cout << "podales zla liczbe \n";   
} 


if(i==1)
{
    cout<<"wybrales kwadrat";
    cout<<endl;
    cout<<"podaj dlugosc bokow";
    cout<<endl;
    cin >> a;
    cout<<"wynik = " << a*a;
    cout<<endl;
}

if (i==2)
{
    cout<<"Wybrales prostokat";
    cout<<endl;
    cout << "Podaj bok a";
    cout<<endl;
    cin >> a;
    cout << "Podaj bok b";
    cout<<endl;
    cin >> b;
    cout<<"wynik = " << a*b;
    cout<<endl;
}


if (i==3)
{
    cout<<"Wybrales rownoleglobok";
    cout<<endl;
    cout << "Podaj bok a";
    cout<<endl;
    cin >> a;  
    cout << "Podaj wysokosc h";
    cout<<endl;
    cin >> h;
    cout<<"wynik = " << a*h;  
}


if (i==4)
{
    cout<<"Wybrales romb";
    cout<<endl;
    cout << "Podaj bok a";
    cout<<endl;
    cin >> a;
    cout << "Podaj wysokosc h";
    cout<<endl;
    cin >> h;
    cout<<"Wynik = " << a*h/2;
    cout<<endl;
}


         
if (i==5)
{
    cout <<"Wybrales trapez";
    cout <<endl;
    cout << "Podaj bok a";
    cout <<endl;
    cin >> a;
    cout << "Podaj bok b";
    cout <<endl;
    cin >> b;
    cout << "Podaj wysokosc h";
    cout <<endl;
    cin >> h;
    cout <<"Wynik = " << (a+b)*h/2;
    cout <<endl;
}


if (i==6)
{
    cout <<"Wybrales trojkat";
    cout <<endl;
    cout << "Podaj bok a";
    cout <<endl;
    cin >> a;
    cout << "Podaj wysokosc h";
    cout <<endl;
    cin >> h;
    cout <<"wynik = " << 0,5*a*h;
    cout <<endl;
}

if (i==7)
{
    cout<<"Wybrales kolo";
    cout<<endl;
    cout << "Podaj promien r";
    cout<<endl;
    cin >> r;
    cout <<endl;
    cout <<"Wynik = " << 3.14*(r*r);
    cout <<endl;
}



    system("PAUSE");
    return EXIT_SUCCESS;
}
0

no ok dzięki może coś wykminie, ale przyznam że nie bardzo rozumiem te schematy. :/

0

zainteresuj się switchem....

1 użytkowników online, w tym zalogowanych: 0, gości: 1