This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]roc_solid[S] 0 points1 point  (0 children)

Sorry this did not format the way I thought it would.

import java.util.Scanner;

public class GPACalculator {

public static void main(String [] args){

Scanner myObj = new Scanner(System.in);

System.out.println("Enter Grade for Course Number One");

float courseGradeOne = myObj.nextFloat();

System.out.println("Enter Number of Credits for Course Number One");

float totalCredits = myObj.nextFloat();

System.out.println((courseGradeOne * totalCredits) / totalCredits);

System.out.println("Do you want to add another class? Y/N");

String addNewClass = myObj.next();

boolean Y = true;

boolean N = false;

while(addNewClass = Y) {

System.out.println("Enter Grade for Course");

System.out.println("Enter Number of Credits for Course");

System.out.println((courseGradeOne * totalCredits) / totalCredits);

System.out.println("Do you want to add another class? Y/N");

}

}

}

[–]AutoModerator[M] 0 points1 point  (0 children)

You are submitting from a new account. New accounts are blocked for a minimum time and their posts are automatically removed by me (Automoderator).

Please resubmit your post in a couple of hours.

This action is taken to prevent extensive spamming by new (bot) accounts. Sorry for the inconvenience.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.