Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <conio.h>
  4. #include <windows.h>
  5. #include <math.h>
  6.  
  7. using namespace std;
  8.  
  9. int m_choice = 1; //glowny wybor z menuu
  10. float a;
  11. float b;
  12. float c;
  13. int d;
  14. int choice2; //wybor w kolejnsci odejmowania
  15. int choice3; //wybor przy dzieleniu
  16. int f_choice = 1; //figure choice / wybor typu figury
  17. int flat_choice =1; //podmennu figur plaskich
  18. int cube_choice =1; //wybor podmenu kwadratu
  19. int rectangle_choice=1;
  20. int triangle_choice=1;
  21. int trapeze_choice=1;
  22.  
  23.  
  24. int main()
  25. {
  26. while (m_choice != 0)
  27. {
  28. cout << "Co Chcialbys Policzyc?" << endl;
  29. cout << " " << endl;
  30. cout << "1. Suma" << endl;
  31. cout << "2. Roznica" << endl;
  32. cout << "3. Iloczyn" << endl;
  33. cout << "4. Iloraz" << endl;
  34. cout << "5. Ulamek" << endl;
  35. cout << "6. Pierwiastek" << endl;
  36. cout << "7. Potega" << endl;
  37. cout << "8. Parzystosc Liczby"<<endl;
  38. cout << " " << endl;
  39. cout << "9. Nastepna Strona " << endl;
  40. cout << " " << endl;
  41. cout << "0. Wyjdz " << endl;
  42. cout << " " << endl;
  43.  
  44. cin >> m_choice;
  45.  
  46. switch (m_choice)
  47. {
  48. case 0:
  49. break;
  50. case 1:
  51. cout << "Wybierz a: " << endl;
  52. cin >>a;
  53. cout << "Wybierz b: " << endl;
  54. cin >> b;
  55. cout << "Wynik Dodawania To: "<<a+b<<endl;
  56.  
  57. getch();
  58.  
  59. system("cls");
  60. break;
  61.  
  62. case 2:
  63. cout << "Wybierz a: " << endl;
  64. cin >>a;
  65. cout << "Wybierz b: " << endl;
  66. cin >> b;
  67. cout << "1.Odejmij a Od b"<<endl;
  68. cout << "2.Odejmij b Od a"<<endl;
  69.  
  70. cin>>choice2;
  71.  
  72. switch (choice2)
  73. {
  74. case 1:
  75. cout <<"Wynik Odejmowania To: "<<a-b<<endl;
  76. getch();
  77. system("cls");
  78. break;
  79. case 2:
  80. cout <<"Wynik Odejmowania To: "<<b-a<<endl;
  81. getch();
  82. system("cls");
  83. break;
  84. }
  85. break;
  86.  
  87. case 3:
  88. cout << "Wybierz a: " << endl;
  89. cin >>a;
  90. cout << "Wybierz b: " << endl;
  91. cin >> b;
  92.  
  93. cout <<""<<endl;
  94. cout <<"Wynik Mnozenia To: "<<a*b<<endl;
  95.  
  96. getch();cout << " " << endl;
  97. system("cls");
  98. break;
  99.  
  100. case 4:
  101. cout << "Wybierz a: " << endl;
  102. cin >>a;
  103. cout << "Wybierz b: " << endl;
  104. cin >> b;
  105. cout<<""<<endl;
  106. cout << "1.Podziel a Przez b"<<endl;
  107. cout << "2.Podziel b Przez a"<<endl;
  108.  
  109. cin >>choice3;
  110.  
  111. switch (choice3)
  112. {
  113. case 1:
  114. cout <<"Wynik Dzielenia To: "<<a/b<<endl;
  115. getch();
  116. system("cls");
  117. break;
  118. case 2:
  119. cout <<"Wynik Dzielenia To: "<<b/a<<endl;
  120. getch();
  121. system("cls");
  122. break;
  123. }
  124. break;
  125.  
  126. case 5:
  127. cout << "Wybierz Mianownik: " << endl;
  128. cin >>a;
  129. cout << "Wybierz Licznik: " << endl;
  130. cin >> b;
  131. cout <<""<<endl;
  132. cout<<"Rozwiniecie Tego Ulamka To: "<<a/b<<endl;
  133. getch();
  134. system("cls");
  135. break;
  136.  
  137. case 6:
  138. cout << "Wprowadz a: "<<endl;
  139. cin >> a;
  140. cout << "Wprowadz Stopien Pierwiastka: "<<endl;
  141. cin >> b;
  142. cout <<""<<endl;
  143. cout << pow(a, 1/b);
  144.  
  145. getch();
  146. system("cls");
  147. break;
  148.  
  149. case 7:
  150. cout << "Wprowadz a: "<<endl;
  151. cin >> a;
  152. cout << "Wprowadz Potege: "<<endl;
  153. cin >> b;
  154. cout <<""<<endl;
  155. cout << pow(a, b);
  156.  
  157.  
  158. getch();
  159. system("cls");
  160. break;
  161.  
  162. case 8:
  163. cout <<"Podaj Liczbe Do Sprawdzenia: "<<endl;
  164. cin >>d;
  165. if(d%2==0)
  166. {
  167.  
  168. cout <<"Podana Liczba Jest Parzysta"<<endl;
  169. }
  170. else
  171. {
  172.  
  173. cout <<"Podana Liczba Nie Jest Parzysta"<<endl;
  174. }
  175. getch();
  176. system("cls");
  177. break;
  178.  
  179. case 9:
  180. system("cls");
  181. cout <<"---------------------------------"<<endl;
  182. cout <<" Kalkulator Bryl "<<endl;
  183. cout <<"---------------------------------"<<endl;
  184. cout << " " << endl;
  185. cout << "Co Chcialbys Policzyc?" << endl;
  186. cout << " " << endl;
  187. cout << "1. Figury Plaskie" << endl;
  188. cout << ""<<endl;
  189. cout << "2. Bryly" << endl;
  190. cin >>f_choice;
  191. system("cls");
  192.  
  193.  
  194. switch(f_choice)
  195. {
  196. case 1:
  197.  
  198. cout << "Wybierz Figure: " << endl;
  199. cout << " " << endl;
  200. cout << "1. Kwadrat" << endl;
  201. cout << "2. Prostokat" << endl;
  202. cout << "3. Trojkat" << endl;
  203. cout << "4. Trapez" << endl;
  204. cout << "5. Romb" << endl;
  205. cout << "6. Kolo" << endl;
  206. cout << " " << endl;
  207. cout << "8. Poprzednia Strona"<<endl;
  208. cout << "9. Nastepna Strona " << endl;
  209. cout << " " << endl;
  210. cout << "0. Wyjdz " << endl;
  211. cout << " " << endl;
  212. cin >>flat_choice;
  213. system("cls");
  214.  
  215.  
  216. switch(flat_choice)
  217. {
  218. case 1:
  219. cout <<"1. Oblicz Pole"<<endl;
  220. cout <<"2. Oblicz Obwod"<<endl;
  221. cout <<"3. Oblicz Brakujace Ramie"<<endl;
  222.  
  223. cin>>cube_choice;
  224.  
  225. switch(cube_choice)
  226. {
  227. case 1:
  228.  
  229. system("cls");
  230. cout <<"Podaj a: "<<endl;
  231. cin >> a;
  232. cout <<"Pole Wynosi: "<<a*a<<endl;
  233. getch();
  234. system("cls");
  235. break;
  236.  
  237. case 2:
  238. system("cls");
  239. cout <<"Podaj a: "<<endl;
  240. cin >> a;
  241. cout <<"Obwod Wynosi: "<<a*4<<endl;
  242. getch();
  243. system("cls");
  244. break;
  245.  
  246. case 3:
  247. system("cls");
  248. cout <<"Z Czego Wyliczyc Brakujace Ramie? "<<endl;
  249. cout <<"1. Z Obwodu"<<endl;
  250. cout <<"2. Z Pola"<<endl;
  251. cin >> a;
  252. system("cls");
  253. if (a==1)
  254. {
  255. cout<<"Podaj Obwod: "<<endl;
  256. cin >> a;
  257. cout<<"Ramie Jest Rowne: "<<a/4<<endl;
  258. getch();
  259. system("cls");
  260. break;
  261. }
  262. else
  263. {
  264. cout<<"Podaj Pole: "<<endl;
  265. cin >> a;
  266. b = 2;
  267. cout<<"Ramie Jest Rowne: "<<pow(a, 1/b)<<endl;
  268.  
  269. getch();
  270. system("cls");
  271. break;
  272.  
  273. }
  274.  
  275. getch();
  276. system("cls");
  277. break;
  278.  
  279. }
  280.  
  281. case 2:
  282. cout <<"1. Oblicz Pole"<<endl;
  283. cout <<"2. Oblicz Obwod"<<endl;
  284. cout <<"3. Oblicz Brakujace Ramie"<<endl;
  285.  
  286. cin>>rectangle_choice;
  287.  
  288. switch(rectangle_choice)
  289. {
  290. case 1:
  291.  
  292. system("cls");
  293. cout <<"Podaj a: "<<endl;
  294. cin >> a;
  295. cout <<"Podaj b; "<<endl;
  296. cin >> b;
  297. cout <<"Pole Wynosi: "<<a*b<<endl;
  298. getch();
  299. system("cls");
  300. break;
  301.  
  302. case 2:
  303. system("cls");
  304. cout <<"Podaj a: "<<endl;
  305. cin >> a;
  306. cout <<"Podaj b: "<<endl;
  307. cin >>b;
  308. cout <<"Obwod Wynosi: "<<a*2+b*2<<endl;
  309. getch();
  310. system("cls");
  311. break;
  312.  
  313. case 3:
  314. system("cls");
  315. cout <<"Z Czego Wyliczyc Brakujace Ramie? "<<endl;
  316. cout <<"1. Z Obwodu"<<endl;
  317. cout <<"2. Z Pola"<<endl;
  318. cin >> d;
  319. system("cls");
  320.  
  321. switch(d)
  322. {
  323. case 1:
  324. cout <<"Podaj Znane Ramie: "<<endl;
  325. cin>>a;
  326. cout <<"Podaj Obwod: "<<endl;
  327. cin>>b;
  328. cout <<"Brakujace Ramie Ma Wartosc: "<<a*2-b<<endl;
  329. getch();
  330. system("cls");
  331. break;
  332.  
  333. case 2:
  334. cout <<"Podaj Znane Ramie: "<<endl;
  335. cin>>a;
  336. cout <<"Podaj Pole: "<<endl;
  337. cin>>b;
  338. cout<<"Brakujace Ramie Ma Wartosc: "<<b/a<<endl;
  339.  
  340. getch();
  341. system("cls");
  342. break;
  343. }
  344. }
  345. case 3:
  346.  
  347. cout <<"1. Oblicz Pole"<<endl;
  348. cout <<"2. Oblicz Obwod"<<endl;
  349. cout <<"3. Oblicz Brakujace Ramie"<<endl;
  350.  
  351. cin>>triangle_choice;
  352. {
  353.  
  354. switch(triangle_choice)
  355. {
  356. case 1:
  357. cout <<"Podaj a: "<<endl;
  358. cin>>a;
  359. cout <<"Podaj h: "<<endl;
  360. cin>>b;
  361. cout<<"Pole Jest Rowne: "<<(a*b)/2<<endl;
  362. getch();
  363. system("cls");
  364. break;
  365. case 2:
  366.  
  367. cout<<"Czy Trojkat Jest Prostokatny?"<<endl;
  368. cout<<""<<endl;
  369. cout<<"1. Tak"<<endl;
  370. cout<<"2. Nie"<<endl;
  371. cin>>a;
  372.  
  373. if(a==1)
  374. {
  375. cout<<"Podaj h: "<<endl;
  376. cin>>a;
  377. cout<<"Podaj druga przy prostokatna: "<<endl;
  378. cin>>b;
  379. c = pow(a, 2)+pow(b, 2);
  380. c = sqrt(c);
  381.  
  382.  
  383. cout<<"Obwod Jest Rowny: "<<c*2+b*2<<endl;
  384. getch();
  385. system("cls");
  386. break;
  387. }
  388.  
  389.  
  390.  
  391. }
  392. }
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399. }
  400.  
  401. case 4:
  402.  
  403. //trapeze
  404. cout <<"1. Oblicz Pole"<<endl;
  405. cout <<"2. Oblicz Obwod"<<endl;
  406. cout <<"3. Oblicz Brakujace Ramie"<<endl;
  407.  
  408. cin>>trapeze_choice;
  409.  
  410. switch(trapeze_choice)
  411. {
  412. case 1:
  413. cout <<"Podaj a: "<<endl;
  414. cin>>a;
  415. cout <<"Podaj b: "<<endl;
  416. cin>>b;
  417. cout <<"Podaj h: "<<endl;
  418. cin>>c;
  419. cout <<"Pole Jest Rowne: "<<((a+b)*c)/2<<endl;
  420. }
  421.  
  422.  
  423. }
  424.  
  425.  
  426.  
  427. }
  428. }
  429.  
  430. return 0;
  431. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement