Advertisement
Guest User

nested if SHATEMENTS #RoadToC++

a guest
Oct 20th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.73 KB | None | 0 0
  1. #include <iomanip>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5.  
  6. int main() {
  7. cout << setiosflags(ios::left);
  8. cout << resetiosflags(ios::adjustfield);
  9. double interest, month, deposit;
  10.  
  11.  
  12. cout << "Insert Money Deposited:" << endl;
  13. cin >> deposit;
  14.  
  15.  
  16.  
  17. if(deposit >= 10000)
  18. {
  19. cout << "Match the correseponding duration the money has been in the bank with a number 1-6" << endl;
  20. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  21. cout << "1. 1-11 Months\n2. 12-23 Months\n3. 24-35 Months\n4. 36-47 Months\n5. 48-59 Months\n6. 60-120 Months" << endl;
  22. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  23. cin >> month;
  24. if(month == 1)
  25. {
  26. cout << "Insert the exact amount of months\n";
  27. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  28. cin >> month;
  29. interest=(deposit*month)/100;
  30. cout << "Interest is:" << interest;
  31. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  32. }
  33. if(month == 2)
  34. {
  35. cout << "Insert the exact amount of months\n";
  36. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  37. cin >> month;
  38. interest=(deposit*month)/100;
  39. cout << "Interest is:" << interest;
  40. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  41. }
  42. if(month == 3)
  43. {
  44. cout << "Insert the exact amount of months\n";
  45. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  46. cin >> month;
  47. interest=(deposit*month)/100;
  48. cout << "Interest is:" << interest;
  49. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  50. }
  51. if(month == 4)
  52. {
  53. cout << "Insert the exact amount of months\n";
  54. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  55. cin >> month;
  56. interest=(deposit*month)/100;
  57. cout << "Interest is:" << interest;
  58. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  59. }
  60. if(month == 5)
  61. {
  62. cout << "Insert the exact amount of months\n";
  63. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  64. cin >> month;
  65. interest=(deposit*month)/100;
  66. cout << "Interest is:" << interest;
  67. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  68. }
  69. if(month == 6)
  70. {
  71. cout << "Insert the exact amount of months\n";
  72. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  73. cin >> month;
  74. interest=(deposit*month)/100;
  75. cout << "Interest is:" << interest;
  76. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  77. }
  78. }
  79. else if(deposit <= 10001 && deposit >= 100000)
  80. {
  81. cout << "Match the correseponding duration the money has been in the bank with a number 1-6" << endl;
  82. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  83. cout << "1. 1-11 Months\n2. 12-23 Months\n3. 24-35 Months\n4. 36-47 Months\n5. 48-59 Months\n6. 60-120 Months" << endl;
  84. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  85. cin >> month;
  86. if(month == 1)
  87. {
  88. cout << "Insert the exact amount of months\n";
  89. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  90. cin >> month;
  91. interest=(deposit*month)/100;
  92. cout << "Interest is:" << interest;
  93. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  94. }
  95. if(month == 2)
  96. {
  97. cout << "Insert the exact amount of months\n";
  98. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  99. cin >> month;
  100. interest=(deposit*month)/100;
  101. cout << "Interest is:" << interest;
  102. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  103. }
  104. if(month == 3)
  105. {
  106. cout << "Insert the exact amount of months\n";
  107. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  108. cin >> month;
  109. interest=(deposit*month)/100;
  110. cout << "Interest is:" << interest;
  111. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  112. }
  113. if(month == 4)
  114. {
  115. cout << "Insert the exact amount of months\n";
  116. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  117. cin >> month;
  118. interest=(deposit*month)/100;
  119. cout << "Interest is:" << interest;
  120. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  121. }
  122. if(month == 5)
  123. {
  124. cout << "Insert the exact amount of months\n";
  125. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  126. cin >> month;
  127. interest=(deposit*month)/100;
  128. cout << "Interest is:" << interest;
  129. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  130. }
  131. if(month == 6)
  132. {
  133. cout << "Insert the exact amount of months\n";
  134. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  135. cin >> month;
  136. interest=(deposit*month)/100;
  137. cout << "Interest is:" << interest;
  138. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  139. }
  140. }
  141. else if(deposit <= 100001)
  142. {
  143. cout << "Match the correseponding duration the money has been in the bank with a number 1-6" << endl;
  144. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  145. cout << "1. 1-11 Months\n2. 12-23 Months\n3. 24-35 Months\n4. 36-47 Months\n5. 48-59 Months\n6. 60-120 Months" << endl;
  146. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  147. cin >> month;
  148. if(month == 1)
  149. {
  150. cout << "Insert the exact amount of months\n";
  151. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  152. cin >> month;
  153. interest=(deposit*month)/100;
  154. cout << "Interest is:" << interest;
  155. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  156.  
  157. }
  158. if(month == 2)
  159. {
  160. cout << "Insert the exact amount of months\n";
  161. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  162. cin >> month;
  163. interest=(deposit*month)/100;
  164. cout << "Interest is:" << interest;
  165. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  166. }
  167. if(month == 3)
  168. {
  169. cout << "Insert the exact amount of months\n";
  170. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  171. cin >> month;
  172. interest=(deposit*month)/100;
  173. cout << "Interest is:" << interest;
  174. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  175. }
  176. if(month == 4)
  177. {
  178. cout << "Insert the exact amount of months\n";
  179. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  180. cin >> month;
  181. interest=(deposit*month)/100;
  182. cout << "Interest is:" << interest;
  183. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  184. }
  185. if(month == 5)
  186. {
  187. cout << "Insert the exact amount of months\n";
  188. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  189. cin >> month;
  190. interest=(deposit*month)/100;
  191. cout << "Interest is:" << interest;
  192. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  193. }
  194. if(month == 6)
  195. {
  196. cout << "Insert the exact amount of months\n";
  197. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  198. cin >> month;
  199. interest=(deposit*month)/100;
  200. cout << "Interest is:" << interest;
  201. cout << setfill ('-') << setw (80) << "" << setfill(' ') << setw (1) << "" << endl;
  202. }
  203.  
  204. }
  205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement