Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(outcome1.equalsIgnoreCase("Yes")){
- import java.util.Scanner; //taking input from user
- public class UCAS //defining class name
- {
- //Run the step1 method first
- public static void main (String[]args){
- step1();
- }
- //defining global variables + read input
- public static String option1 = "BTEC 90 Credit Diploma", option2 = "BTEC 90 Credit Extended Diploma", option3 = "Functional Skills", option4 = "Help", option5 = "Quit", username, finalGrade="", PASS = "P", MER = "M", DIST = "D", Stringoutline = "+-----------------------------------------------------+", outcome1="", Stringoutline2 = "+-------------------------------------------------------+";
- public static int P=70, M=80, D=90, FunSkillPoints=10, year1points=0, year2points=0, option, ucasPoints=0;
- public static Scanner userinput=new Scanner(System.in);
- /* Getting the user to make their choice for which task they wish to proceed with */
- public static void step1(){
- Scanner one = new Scanner(System.in);
- System.out.println("Please enter your name:" );
- username=userinput.next(); // getting a String value
- System.out.println("Welcome to Liam's JAVA program " + username + ". This program allows you to convert your grade into USCAS points.");
- System.out.println(username + ", please enter the number next to the task you wish to proceed with." );
- System.out.println(Stringoutline);
- System.out.println("1 |" + (option1) +" |");
- System.out.println("2 |" + (option2) +" |");
- System.out.println("3 |" + (option3) +" |");
- System.out.println("4 |" + (option4) +" |");
- System.out.println("5 |" + (option5) +" |");
- System.out.println(Stringoutline);
- option=userinput.nextInt();
- if (option==5) {
- System.out.println("Thanks for using Liam's UCAS grade calculator.");
- System.exit(0);
- }
- if (option==4) {
- System.out.println("You have chosen the option 'help'.");
- helpsection();
- }
- if (option==3) {
- System.out.println("You have chosen the option 'functional skills'.");
- FunctionalSkills();
- }
- if (option==2) {
- System.out.println("You have chosen 'BTEC Extended Diploma'");
- System.out.println("Please enter the grade you got for each of the units "+(PASS)+ " " + (MER)+ " " + (DIST)+".");
- NinetyCredExtend();
- }
- if (option==1){
- System.out.println("You have chosen 'BTEC 90 Credit Diploma'");
- System.out.println("Please enter the grade you got for each of the units "+(PASS)+ " " + (MER)+ " " + (DIST)+".");
- NinetyCredCalc();
- }
- }
- //Getting the user to enter their grades for the extended course + calculation/ouputting their grade
- public static void NinetyCredExtend(){
- String grade;
- int yr2cred[] = new int[18];
- char year2Grades[] = new char[18];
- for(int i=1; i<=18; i++){
- System.out.println("Please enter the grade for Unit " +i);
- grade=userinput.next();
- year2Grades[i-1] = grade.charAt(0);
- if(year2Grades[i-1] == 'P' || year2Grades[i-1] == 'p') {
- yr2cred[i-1] = yr2cred [i-1] + P;
- }
- if(year2Grades[i-1] == 'M' || year2Grades[i-1] == 'm') {
- yr2cred[i-1] = yr2cred [i-1] + M;
- }
- if(year2Grades[i-1] == 'D' || year2Grades[i-1] == 'd') {
- yr2cred[i-1] = yr2cred [i-1] + D;
- }
- }
- for(int j=0; j<18; j++){
- year2points = year2points + yr2cred[j];
- }
- if(year2points<1300){
- finalGrade="PPP";
- ucasPoints=48;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1300 & year2points<1339){
- finalGrade="MPP";
- ucasPoints=64;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1340 & year2points<1379){
- finalGrade="MMP";
- ucasPoints=80;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1380 & year2points<1419){
- finalGrade="MMM";
- ucasPoints=96;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1420 & year2points<1459){
- finalGrade="DMM";
- ucasPoints=112;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1460 & year2points<1499){
- finalGrade="DDM";
- ucasPoints=128;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1500 & year2points<1529){
- finalGrade="DDD";
- ucasPoints=144;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1530 & year2points<1559){
- finalGrade="D*DD";
- ucasPoints=152;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1560 & year2points<1589){
- finalGrade="D*D*D";
- ucasPoints=160;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- if(year2points >=1590){
- finalGrade="D*D*D*";
- ucasPoints=168;
- System.out.println(" You have scored "+year2points +" BTEC Points");
- }
- System.out.println("Your BTEC Grade is: "+finalGrade);
- System.out.println("Your UCAS Points are: "+ucasPoints);
- System.out.println("Do you have any Functional Skills Qualification?");
- System.out.println("Please enter the one of the following exactly how you see on your display 'Yes' or 'No'");
- outcome1=userinput.next();
- if(outcome1.equalsIgnoreCase("Yes")){
- FunctionalSkills();
- }
- if(outcome1.equalsIgnoreCase("No")){
- System.out.println("Thanks for using the Liam's UCAS grade calculator.");
- System.exit(0);
- }
- }
- //Getting the user to enter their grades for the 90cred course + calculation/ouputting their grade
- public static void NinetyCredCalc(){
- String grade;
- int yr1cred[] = new int[9];
- char yr1grade[] = new char[9];
- for(int i=1; i<=9; i++){
- System.out.println("Please enter the grade for Unit " +i);
- grade=userinput.next();
- yr1grade[i-1]=grade.charAt(0);
- if(yr1grade[i-1] == 'P' || yr1grade[i-1] == 'p') {
- yr1cred[i-1] = yr1cred [i-1] + P;
- }
- if(yr1grade[i-1] == 'M' || yr1grade[i-1] == 'm') {
- yr1cred[i-1] = yr1cred [i-1] + M;
- }
- if(yr1grade[i-1] == 'D' || yr1grade[i-1] == 'd') {
- yr1cred[i-1] = yr1cred [i-1] + D;
- }
- }
- for(int j=0; j<9; j++){
- year1points = year1points + yr1cred[j];
- }
- if(year1points >=630 & year1points<660){
- finalGrade="PP";
- ucasPoints=32;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=660 & year1points<689){
- finalGrade="MP";
- ucasPoints=48;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=690 & year1points<719){
- finalGrade="MM";
- ucasPoints=64;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=720 & year1points<749){
- finalGrade="DM";
- ucasPoints=80;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=750 & year1points<769){
- finalGrade="DD";
- ucasPoints=96;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=770 & year1points<789){
- finalGrade="D*D";
- ucasPoints=104;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- if(year1points >=790){
- finalGrade="D*D*";
- ucasPoints=112;
- System.out.println(" You have scored "+year1points +" BTEC Points");
- }
- System.out.println("Your BTEC Grade is: "+finalGrade);
- System.out.println("Your UCACs Points are: "+ucasPoints);
- System.out.println("Do you have one or more functional skills qualifications?");
- System.out.println("Please enter the one of the following exactly how you see on your display 'Yes' or 'No'");
- outcome1=userinput.next();
- if(outcome1=="Yes"){
- FunctionalSkills();
- }
- if(outcome1=="No"){
- System.out.println("Thanks for using the Liam's UCAS grade calculator.");
- System.exit(0);
- }
- }
- //Calculation for the user to work out their FS grade
- public static void FunctionalSkills(){
- int FunctionalSkills, totalUcasPoints;
- System.out.println("How many functional skills Level 2 qualifications do you have? Please only enter one of the integers you see 1 or 2.)");
- FunctionalSkills=userinput.nextInt();
- if(FunctionalSkills==1) {
- FunctionalSkills=10;
- totalUcasPoints=FunctionalSkills+ucasPoints;
- System.out.println("Your UCAS points are: "+totalUcasPoints);
- System.out.println("Thanks for using Liam's UCAS grade calculator");
- }
- if(FunctionalSkills==2){
- FunSkillPoints=20;
- totalUcasPoints=FunSkillPoints+ucasPoints;
- System.out.println("Your UCAS points are: "+totalUcasPoints);
- System.out.println("Thanks for using Liam's UCAS grade calculator");
- }
- }
- //help section method
- public static void helpsection(){
- System.out.println("How use the program");
- step1();
- }
- }
Add Comment
Please, Sign In to add comment