Advertisement
MarufA

1st program swag

Feb 26th, 2013
3,116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float grade = random(0,100);
  2. println ("The random grade is " + grade);
  3. if (grade > 90) {
  4.   println("Assign letter grade A.");
  5. } else if (grade >= 85) {
  6.   println("Assign letter grade B+.");
  7.   } else if (grade >= 80) {
  8.   println("Assign letter grade B.");
  9.   } else if (grade >= 75) {
  10.   println("Assign letter grade C+.");
  11.   } else if (grade >= 70) {
  12.   println("Assign letter grade C.");
  13.   } else if (grade >= 65) {
  14.   println("Assign letter grade D+.");
  15.   } else if (grade >= 60) {
  16.   println("Assign letter grade D.");
  17.   } else {
  18.   println("FAIL");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement