Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What grade do you need to get on your final?
#1
With finals rolling around the corner. I wanted to put together a quick program to calculate the grades I would need to get on my final in order to get a certain grade in the class. This will only work if your Final is wieghted for 20% of your grade. I made this more for personal use. But I figure I'll put it out there.

Code:
import java.util.Scanner;
import java.lang.String;
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int currentgrade;
        String wantedgrade;
        System.out.println("************************");
        System.out.println("******Final Finder******");
        System.out.println("********nevets04********");
        System.out.println("************************");

        System.out.print("What is your current grade?(%): ");
        currentgrade = input.nextInt();
        System.out.print("What grade do you want?(A,B,C,D,F): ");
        wantedgrade = input.next();
        if (wantedgrade.contentEquals("A")){
            int neededgrade = currentgrade*4-450;
            neededgrade = neededgrade - (neededgrade*2);
            System.out.print(neededgrade);
            System.out.println("%");
        }
        else if (wantedgrade.contentEquals("B")){
            int neededgrade = currentgrade*4-400;
            neededgrade = neededgrade - (neededgrade*2);
            System.out.print(neededgrade);
            System.out.println("%");
        }
        else if (wantedgrade.contentEquals("C")){
            int neededgrade = currentgrade*4-400;
            neededgrade = neededgrade - (neededgrade*2);
            System.out.print(neededgrade);
            System.out.println("%");
        }
        else if (wantedgrade.contentEquals("D")){
            int neededgrade = currentgrade*4-400;
            neededgrade = neededgrade - (neededgrade*2);
            System.out.print(neededgrade);
            System.out.println("%");
        }
        else if (wantedgrade.contentEquals("F")){
            int neededgrade = currentgrade*4-400;
            neededgrade = neededgrade - (neededgrade*2);
            System.out.print(neededgrade);
            System.out.println("%");
        }
        else {
            System.out.println("Error");

        }


    }

}
Reply
#2
I just get +93% on everything. I suck horribly at English and got a 80 on the final, but I still got a 94% in the class in the end. Straight A's for the win. Do you know how you get straight A's?

1)Procrastination
2)Laziness
3)Don't pay attention during class
4)Forget to turn in your homework

.....or at least that's what I do >.>
[Image: hstj7q.png]
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)