Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- int main()
- {
- int pyt1=99,pyt2=99,pyt3=99,pyt4=99,pyt5=99;
- float pk1=0,pk2=0,pk3=0,pk4=0,pk5=0;
- float ile1=0,ile2=0,ile3=0,ile4=0,ile5=0;
- cout << string(50, '\n');
- cout << "Ankieta!" << endl;
- cout << "Pytanie 1(poprawna odp - 1)" << endl;
- {
- cin >> pyt1;
- if(pyt1!=0)
- ile1++;
- if (pyt1==1)
- pk1++;
- }
- cout << string(50, '\n');
- cout << "Pytanie 2(poprawna odp - 2)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt2!=0)
- {
- cin >> pyt2;
- if(pyt2!=0)
- ile2=ile2+2;
- if (pyt2==2)
- pk2=pk2+2;
- }
- cout << string(50, '\n');
- cout << "Pytanie 3(poprawna odp - 3)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt3!=0)
- {
- cin >> pyt3;
- if(pyt3!=0)
- ile3=ile3+3;
- if (pyt3==3)
- pk3=pk3+3;
- }
- cout << string(50, '\n');
- cout << "Pytanie 4(poprawna odp - 4)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt4!=0)
- {
- cin >> pyt4;
- if(pyt4!=0)
- ile4=ile4+4;
- if (pyt4==4)
- pk4=pk4+4;
- }
- cout << string(50, '\n');
- cout << "Pytanie 5(poprawna odp - 5)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt5!=0)
- {
- cin >> pyt5;
- if(pyt5!=0)
- ile5=ile5+5;
- if (pyt5==5)
- pk5=pk5+5;
- }
- cout << "\nPunkty pyt.1 - " << pk1 << endl;
- cout << "\nPunkty pyt.2 - " << pk2 << endl;
- cout << "\nPunkty pyt.3 - " << pk3 << endl;
- cout << "\nPunkty pyt.4 - " << pk4 << endl;
- cout << "\nPunkty pyt.5 - " << pk5 << endl;
- cout << endl;
- float pro1=((pk1/ile1)*10);
- float pro2=((pk2/ile2)*10);
- float pro3=((pk3/ile3)*10);
- float pro4=((pk4/ile4)*10);
- float pro5=((pk5/ile5)*10);
- cout << "Wyniki(# = 10%): \n" << endl;
- cout << "Pytanie 1: ";
- cout << string(pro1, '#');
- cout << endl;
- cout << "Pytanie 2: ";
- cout << string(pro2, '#');
- cout << endl;
- cout << "Pytanie 3: ";
- cout << string(pro3, '#');
- cout << endl;
- cout << "Pytanie 4: ";
- cout << string(pro4, '#');
- cout << endl;
- cout << "Pytanie 5: ";
- cout << string(pro5, '#');
- cout << endl;
- return 0;
- } cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt1!=0)
- {
- cin >> pyt1;
- if(pyt1!=0)
- ile1++;
- if (pyt1==1)
- pk1++;
- }
- cout << string(50, '\n');
- cout << "Pytanie 2(poprawna odp - 2)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt2!=0)
- {
- cin >> pyt2;
- if(pyt2!=0)
- ile2=ile2+2;
- if (pyt2==2)
- pk2=pk2+2;
- }
- cout << string(50, '\n');
- cout << "Pytanie 3(poprawna odp - 3)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt3!=0)
- {
- cin >> pyt3;
- if(pyt3!=0)
- ile3=ile3+3;
- if (pyt3==3)
- pk3=pk3+3;
- }
- cout << string(50, '\n');
- cout << "Pytanie 4(poprawna odp - 4)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt4!=0)
- {
- cin >> pyt4;
- if(pyt4!=0)
- ile4=ile4+4;
- if (pyt4==4)
- pk4=pk4+4;
- }
- cout << string(50, '\n');
- cout << "Pytanie 5(poprawna odp - 5)" << endl;
- cout << "Odp.1 Odp.2 Odp.3 Odp.4 Odp.5\n" << endl;
- while (pyt5!=0)
- {
- cin >> pyt5;
- if(pyt5!=0)
- ile5=ile5+5;
- if (pyt5==5)
- pk5=pk5+5;
- }
- cout << "\nPunkty pyt.1 - " << pk1 << endl;
- cout << "\nPunkty pyt.2 - " << pk2 << endl;
- cout << "\nPunkty pyt.3 - " << pk3 << endl;
- cout << "\nPunkty pyt.4 - " << pk4 << endl;
- cout << "\nPunkty pyt.5 - " << pk5 << endl;
- cout << endl;
- float pro1=((pk1/ile1)*10);
- float pro2=((pk2/ile2)*10);
- float pro3=((pk3/ile3)*10);
- float pro4=((pk4/ile4)*10);
- float pro5=((pk5/ile5)*10);
- cout << "Wyniki(# = 10%): \n" << endl;
- cout << "Pytanie 1: ";
- cout << string(pro1, '#');
- cout << endl;
- cout << "Pytanie 2: ";
- cout << string(pro2, '#');
- cout << endl;
- cout << "Pytanie 3: ";
- cout << string(pro3, '#');
- cout << endl;
- cout << "Pytanie 4: ";
- cout << string(pro4, '#');
- cout << endl;
- cout << "Pytanie 5: ";
- cout << string(pro5, '#');
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement