Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.13 KB | None | 0 0
  1. //10.6.2015
  2. //BYOLab
  3. import java.util.Scanner;
  4. public class BYOLab
  5. {
  6. public static void main (String [] args)
  7. {
  8. Scanner input = new Scanner (System.in);
  9. System.out.println (" GPA Calculating Program");
  10. System.out.println (" by: Marshall Theis");
  11. System.out.println ("\nHow many classes do you have(5-7)? ");
  12. int numberOfClasses = input.nextInt ();
  13. input.nextLine();
  14. if (numberOfClasses >= 5)
  15. {
  16. //grades
  17.  
  18. System.out.println ("What is the name of class 1? ");
  19. String class1 = input.nextLine ();
  20. System.out.println ("What is the name of class 2? ");
  21. String class2 = input.nextLine ();
  22. System.out.println ("What is the name of class 3? ");
  23. String class3 = input.nextLine ();
  24. System.out.println ("What is the name of class 4? ");
  25. String class4 = input.nextLine ();
  26. System.out.println ("What is the name of class 5? ");
  27. String class5 = input.nextLine ();
  28. String class6 = "a";
  29. String class7 = "b";
  30. if (numberOfClasses >= 6)
  31. {
  32. System.out.println ("What is the name of class 6? ");
  33. class6 = input.nextLine ();
  34. if (numberOfClasses == 7)
  35. {
  36. System.out.println ("What is the name of class 7? ");
  37. class7 = input.nextLine ();
  38. }
  39. }
  40. System.out.println ("\nWhat is your grade in "+ class1 +"? ");
  41. int grade1 = input.nextInt ();
  42. System.out.println ("What is your grade in "+ class2 +"? ");
  43. int grade2 = input.nextInt ();
  44. System.out.println ("What is your grade in "+ class3 +"? ");
  45. int grade3 = input.nextInt ();
  46. System.out.println ("What is your grade in "+ class4 +"? ");
  47. int grade4 = input.nextInt ();
  48. System.out.println ("What is your grade in "+ class5 +"? ");
  49. int grade5 = input.nextInt ();
  50. if (numberOfClasses == 6)
  51. {
  52. System.out.println ("What is your grade in "+ class6 +"? ");
  53. int grade6 = input.nextInt ();
  54. if (numberOfClasses == 7)
  55. {
  56. System.out.println ("What is your grade in "+ class7 +"? ");
  57. int grade7 = input.nextInt ();
  58. }
  59. }
  60. //points
  61. double points1=0;
  62. double points2=0;
  63. double points3=0;
  64. double points4=0;
  65. double points5=0;
  66. double points6=0;
  67. double points7=0;
  68. //GRADE1_____________________________________________________________GRADE1//
  69. //A
  70. if (grade1>=93)
  71. {
  72. points1 = points1 + 4;
  73. }
  74. //A-
  75. if (grade1>=90 && grade1<=92)
  76. {
  77. points1 = points1 +3.7;
  78. }
  79. //B+
  80. if (grade1>=87 && grade1<=89)
  81. {
  82. points1 = points1 +3.3;
  83. }
  84. //B
  85. if (grade1>=83 && grade1>=86)
  86. {
  87. points1 = points1 +3.0;
  88. }
  89. //B-
  90. if (grade1>=80 && grade1>=82)
  91. {
  92. points1 = points1 +2.7;
  93. }
  94. //C+
  95. if (grade1>=77 && grade1>=79)
  96. {
  97. points1 = points1 +2.3;
  98. }
  99. //C
  100. if (grade1>=73 && grade1>=78)
  101. {
  102. points1 = points1 +2.0;
  103. }
  104. //C-
  105. if (grade1>=70 && grade1>=72)
  106. {
  107. points1 = points1 +1.7;
  108. }
  109. //D+
  110. if (grade1>=67 && grade1>=69)
  111. {
  112. points1 = points1 +1.3;
  113. }
  114. //D
  115. if (grade1>=63 && grade1>=66)
  116. {
  117. points1 = points1 +1.0;
  118. }
  119. //D-
  120. if (grade1>=60 && grade1>=62)
  121. {
  122. points1 = points1 +0.7;
  123. }
  124. //F
  125. if (grade1>=0 && grade1>=59)
  126. {
  127. points1 = points1 +0;
  128. }
  129. //GRADE2_____________________________________________________________GRADE2//
  130. //A
  131. if (grade2>=93)
  132. {
  133. points2 = points2 + 4;
  134. }
  135. //A-
  136. if (grade2>=90 && grade2<=92)
  137. {
  138. points2 = points2 +3.7;
  139. }
  140. //B+
  141. if (grade2>=87 && grade2<=89)
  142. {
  143. points2 = points2 +3.3;
  144. }
  145. //B
  146. if (grade2>=83 && grade2>=86)
  147. {
  148. points2 = points2 +3.0;
  149. }
  150. //B-
  151. if (grade2>=80 && grade2>=82)
  152. {
  153. points2 = points2 +2.7;
  154. }
  155. //C+
  156. if (grade2>=77 && grade2>=79)
  157. {
  158. points2 = points2 +2.3;
  159. }
  160. //C
  161. if (grade2>=73 && grade2>=78)
  162. {
  163. points2 = points2 +2.0;
  164. }
  165. //C-
  166. if (grade2>=70 && grade2>=72)
  167. {
  168. points2 = points2 +1.7;
  169. }
  170. //D+
  171. if (grade2>=67 && grade2>=69)
  172. {
  173. points2 = points2 +1.3;
  174. }
  175. //D
  176. if (grade2>=63 && grade2>=66)
  177. {
  178. points2 = points2 +1.0;
  179. }
  180. //D-
  181. if (grade2>=60 && grade2>=62)
  182. {
  183. points2 = points2 +0.7;
  184. }
  185. //F
  186. if (grade2>=0 && grade2>=59)
  187. {
  188. points2 = points2 +0;
  189. }
  190. //GRADE3_____________________________________________________________GRADE3//
  191. //A
  192. if (grade3>=93)
  193. {
  194. points3 = points3 + 4;
  195. }
  196. //A-
  197. if (grade3>=90 && grade3<=92)
  198. {
  199. points3 = points3 +3.7;
  200. }
  201. //B+
  202. if (grade3>=87 && grade3<=89)
  203. {
  204. points3 = points3 +3.3;
  205. }
  206. //B
  207. if (grade3>=83 && grade3>=86)
  208. {
  209. points3 = points3 +3.0;
  210. }
  211. //B-
  212. if (grade3>=80 && grade3>=82)
  213. {
  214. points3 = points3 +2.7;
  215. }
  216. //C+
  217. if (grade3>=77 && grade3>=79)
  218. {
  219. points3 = points3 +2.3;
  220. }
  221. //C
  222. if (grade3>=73 && grade3>=78)
  223. {
  224. points3 = points3 +2.0;
  225. }
  226. //C-
  227. if (grade3>=70 && grade3>=72)
  228. {
  229. points3 = points3 +1.7;
  230. }
  231. //D+
  232. if (grade3>=67 && grade3>=69)
  233. {
  234. points3 = points3 +1.3;
  235. }
  236. //D
  237. if (grade3>=63 && grade3>=66)
  238. {
  239. points3 = points3 +1.0;
  240. }
  241. //D-
  242. if (grade3>=60 && grade3>=62)
  243. {
  244. points3 = points3 +0.7;
  245. }
  246. //F
  247. if (grade3>=0 && grade3>=59)
  248. {
  249. points3 = points3 +0;
  250. }
  251. //GRADE4_____________________________________________________________GRADE4//
  252. //A
  253. if (grade4>=93)
  254. {
  255. points4 = points4 + 4;
  256. }
  257. //A-
  258. if (grade4>=90 && grade4<=92)
  259. {
  260. points4 = points4 +3.7;
  261. }
  262. //B+
  263. if (grade4>=87 && grade4<=89)
  264. {
  265. points4 = points4 +3.3;
  266. }
  267. //B
  268. if (grade4>=83 && grade4>=86)
  269. {
  270. points4 = points4 +3.0;
  271. }
  272. //B-
  273. if (grade4>=80 && grade4>=82)
  274. {
  275. points4 = points4 +2.7;
  276. }
  277. //C+
  278. if (grade4>=77 && grade4>=79)
  279. {
  280. points4 = points4 +2.3;
  281. }
  282. //C
  283. if (grade4>=73 && grade4>=78)
  284. {
  285. points4 = points4 +2.0;
  286. }
  287. //C-
  288. if (grade4>=70 && grade4>=72)
  289. {
  290. points4 = points4 +1.7;
  291. }
  292. //D+
  293. if (grade4>=67 && grade4>=69)
  294. {
  295. points4 = points4 +1.3;
  296. }
  297. //D
  298. if (grade4>=63 && grade4>=66)
  299. {
  300. points4 = points4 +1.0;
  301. }
  302. //D-
  303. if (grade4>=60 && grade4>=62)
  304. {
  305. points4 = points4 +0.7;
  306. }
  307. //F
  308. if (grade4>=0 && grade4>=59)
  309. {
  310. points4 = points4 +0;
  311. }
  312. //GRADE5_____________________________________________________________GRADE5//
  313. //A
  314. if (grade5>=93)
  315. {
  316. points5 = points5 + 4;
  317. }
  318. //A-
  319. if (grade5>=90 && grade5<=92)
  320. {
  321. points5 = points5 +3.7;
  322. }
  323. //B+
  324. if (grade5>=87 && grade5<=89)
  325. {
  326. points5 = points5 +3.3;
  327. }
  328. //B
  329. if (grade5>=83 && grade5>=86)
  330. {
  331. points5 = points5 +3.0;
  332. }
  333. //B-
  334. if (grade5>=80 && grade5>=82)
  335. {
  336. points5 = points5 +2.7;
  337. }
  338. //C+
  339. if (grade5>=77 && grade5>=79)
  340. {
  341. points5 = points5 +2.3;
  342. }
  343. //C
  344. if (grade5>=73 && grade5>=78)
  345. {
  346. points5 = points5 +2.0;
  347. }
  348. //C-
  349. if (grade5>=70 && grade5>=72)
  350. {
  351. points5 = points5 +1.7;
  352. }
  353. //D+
  354. if (grade5>=67 && grade5>=69)
  355. {
  356. points5 = points5 +1.3;
  357. }
  358. //D
  359. if (grade5>=63 && grade5>=66)
  360. {
  361. points5 = points5 +1.0;
  362. }
  363. //D-
  364. if (grade5>=60 && grade5>=62)
  365. {
  366. points5 = points5 +0.7;
  367. }
  368. //F
  369. if (grade5>=0 && grade5>=59)
  370. {
  371. points5 = points5 +0;
  372. }
  373. //GRADE6_____________________________________________________________GRADE6//
  374. //A
  375. if (grade6>=93)
  376. {
  377. points6 = points6 + 4;
  378. }
  379. //A-
  380. if (grade6>=90 && grade6<=92)
  381. {
  382. points6 = points6 +3.7;
  383. }
  384. //B+
  385. if (grade6>=87 && grade6<=89)
  386. {
  387. points6 = points6 +3.3;
  388. }
  389. //B
  390. if (grade6>=83 && grade6>=86)
  391. {
  392. points6 = points6 +3.0;
  393. }
  394. //B-
  395. if (grade6>=80 && grade6>=82)
  396. {
  397. points6 = points6 +2.7;
  398. }
  399. //C+
  400. if (grade6>=77 && grade6>=79)
  401. {
  402. points6 = points6 +2.3;
  403. }
  404. //C
  405. if (grade6>=73 && grade6>=78)
  406. {
  407. points6 = points6 +2.0;
  408. }
  409. //C-
  410. if (grade6>=70 && grade6>=72)
  411. {
  412. points6 = points6 +1.7;
  413. }
  414. //D+
  415. if (grade6>=67 && grade6>=69)
  416. {
  417. points6 = points6 +1.3;
  418. }
  419. //D
  420. if (grade6>=63 && grade6>=66)
  421. {
  422. points6 = points6 +1.0;
  423. }
  424. //D-
  425. if (grade6>=60 && grade6>=62)
  426. {
  427. points6 = points6 +0.7;
  428. }
  429. //F
  430. if (grade6>=0 && grade6>=59)
  431. {
  432. points6 = points6 +0;
  433. }
  434. //GRADE7_____________________________________________________________GRADE7//
  435. //A
  436. if (grade7>=93)
  437. {
  438. points7 = points7 + 4;
  439. }
  440. //A-
  441. if (grade7>=90 && grade7<=92)
  442. {
  443. points7 = points7 +3.7;
  444. }
  445. //B+
  446. if (grade7>=87 && grade7<=89)
  447. {
  448. points7 = points7 +3.3;
  449. }
  450. //B
  451. if (grade7>=83 && grade7>=86)
  452. {
  453. points7 = points7 +3.0;
  454. }
  455. //B-
  456. if (grade7>=80 && grade7>=82)
  457. {
  458. points7 = points7 +2.7;
  459. }
  460. //C+
  461. if (grade7>=77 && grade7>=79)
  462. {
  463. points7 = points7 +2.3;
  464. }
  465. //C
  466. if (grade7>=73 && grade7>=78)
  467. {
  468. points7 = points7 +2.0;
  469. }
  470. //C-
  471. if (grade7>=70 && grade7>=72)
  472. {
  473. points7 = points7 +1.7;
  474. }
  475. //D+
  476. if (grade7>=67 && grade7>=69)
  477. {
  478. points7 = points7 +1.3;
  479. }
  480. //D
  481. if (grade7>=63 && grade7>=66)
  482. {
  483. points7 = points7 +1.0;
  484. }
  485. //D-
  486. if (grade7>=60 && grade7>=62)
  487. {
  488. points7 = points7 +0.7;
  489. }
  490. //F
  491. if (grade7>=0 && grade7>=59)
  492. {
  493. points7 = points7 +0;
  494. }
  495.  
  496. }
  497. }
  498. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement