You are on page 1of 11

package assignment;

import java.util.Scanner;

public class Assignment {

static void UserRegistration(){

Scanner firstPage= new Scanner(System.in);

System.out.println("Registration Page");

System.out.println("Surname");

String Surname=firstPage.nextLine();

System.out.println("Name");

String Name=firstPage.nextLine();

System.out.println("Matric Number");

String MatricNumber =firstPage.nextLine();

System.out.println("School");

String School=firstPage.nextLine();

System.out.println("Welcome "+Surname+" "+Name+" with matric number "+MatricNumber+" of


"+School);

static void CGPACalculator(){

Scanner secondPage= new Scanner(System.in);

System.out.println("This system is to calculate CGPA");

System.out.println("Course Code");

String Course1=secondPage.nextLine();

System.out.println("Unit");

int v=secondPage.nextInt();

System.out.println("Grade point");

int A=secondPage.nextInt();

System.out.println("Course Code");

String Course2=secondPage.nextLine();
System.out.println("Unit");

int w=secondPage.nextInt();

System.out.println("Grade point");

int B=secondPage.nextInt();

System.out.println("Course Code");

String Course3=secondPage.nextLine();

System.out.println("Unit:");

int x=secondPage.nextInt();

System.out.println("Grade point");

int C=secondPage.nextInt();

System.out.println("Course Code");

String Course4=secondPage.nextLine();

System.out.println("Unit");

int y=secondPage.nextInt();

System.out.println("Grade point");

int D=secondPage.nextInt();

System.out.println("Course Code");

String Course5=secondPage.nextLine();

System.out.println("Unit");

int z=secondPage.nextInt();

System.out.println("Grade point");

int E=secondPage.nextInt();

System.out.println("Dear user, your CGPA is "+((A*v)+(B*w)+(C*x)+(D*y)+(E*z))/(z+y+x+w+v));

static void GradingSystem(){

Scanner thirdPage= new Scanner(System.in);

System.out.println("This system is to grade your score");

System.out.println("Enter score");

int B=thirdPage.nextInt();
if(B>=70&&B<100){

System.out.println("A");}

else if(B>=60&&B<=69){

System.out.println("B");

else if(B>=50&&B<=59){

System.out.println("C");

else if(B>=40&&B<=49){

System.out.println("D");

else if(B>=30&&B<=39){

System.out.println("E");}

else if(B<=29){

System.out.println("F");

else

System.out.println("Invalid score");

static void AgeCalculator(){

Scanner fourthPage= new Scanner(System.in);

System.out.println("This system is to calculate your age");

System.out.println("Please enter your birth year");

int m=fourthPage.nextInt();

System.out.println("Please enter the present year");

int n=fourthPage.nextInt();

System.out.println("Dear user,you are "+(n-m)+" years old");

static void QEC(){


Scanner fifthPage=new Scanner(System.in);

System.out.println("Hello!This will help you to calculate quadratic equation question");

System.out.println("Kindly follow the instructions below");

System.out.println("This system follows the normal expression of ax2+bx+c");

System.out.println("So when the system asks you to input a, you enter the coefficient of x2");

System.out.println("And when it asks you to input b, you enter the coefficient of x");

System.out.println("And when it asks of c, you enter the constant");

System.out.println("Hope you understand? If not, read the instructions above again");

System.out.println("Enter a");

int a=fifthPage.nextInt();

System.out.println("Enter b");

int b=fifthPage.nextInt();

System.out.println("Enter c");

int c=fifthPage.nextInt();

static void CC(){

Scanner sixthPage=new Scanner(System.in);

System.out.println("Dear user, this page is to help you convert from one currency to another");

System.out.println("Press 1 to convert from Naira to USD");

System.out.println("Press 2 to convert from Naira to AUD");

System.out.println("Press 3 to convert from Naira to Yen");

System.out.println("Press 4 to convert from Naira to Rupee");

System.out.println("Press 5 to convert from USD to AUD");

System.out.println("Press 6 to convert from USD to Yen");

System.out.println("Press 7 to convert from USD to Naira");

System.out.println("Press 8 to convert from USD to Rupee");

System.out.println("Press 9 to convert from AUD to USD");

System.out.println("Press 10 to convert from AUD to Yen");


System.out.println("Press 11 to convert from AUD to Naira");

System.out.println("Press 12 to convert from AUD to Rupee");

System.out.println("Press 13 to convert from Yen to USD");

System.out.println("Press 14 to convert from Yen to AUD");

System.out.println("Press 15 to convert from Yen to Naira");

System.out.println("Press 16 to convert from Yen to Rupee");

System.out.println("Press 17 to convert from Rupee to USD");

System.out.println("Press 18 to convert from Rupee to AUD");

System.out.println("Press 19 to convert from Rupee to Yen");

System.out.println("Press 20 to convert from Rupee to Naira");

System.out.println("Please enter your choice after carefully reading the instructions above");

System.out.println("Please, make sure to input your choice in Capital letter");

int Choice=sixthPage.nextInt();

if(Choice==1){

System.out.println("Dear user, you are converting from Naira to USD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Naira is equivalent to "+(B/1515.59)+"USD");

else if(Choice==2){

System.out.println("Dear user, you are converting from Naira to AUD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Naira is equivalent to "+(B/951)+"AUD");

else if(Choice==3){

System.out.println("Dear user, you are converting from Naira to Yen");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();
System.out.println("Dear user, "+B+"Naira is equivalent to "+(B/6.12)+"Yen");

} else if(Choice==4){

System.out.println("Dear user, you are converting from Naira to Rupee");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Naira is equivalent to "+(B/17.76)+"Rupee");

else if(Choice==5){

System.out.println("Dear user, you are converting from USD to AUD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"USD is equivalent to "+(B*1.54)+"AUD");

else if(Choice==6){

System.out.println("Dear user, you are converting from USD to Yen");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"USD is equivalent to "+(B*150.13)+"Yen");

else if(Choice==7){

System.out.println("Dear user, you are converting from USD to Naira");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"USD is equivalent to "+(B*1515.59)+"Naira");

else if(Choice==8){

System.out.println("Dear user, you are converting from USD to Rupee");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();
System.out.println("Dear user, "+B+"USD is equivalent to "+(B*83.02)+"Rupee");

else if(Choice==9){

System.out.println("Dear user, you are converting from AUD to USD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"AUD is equivalent to "+(B*0.65)+"USD");

else if(Choice==10){

System.out.println("Dear user, you are converting from AUD to Yen");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"AUD is equivalent to "+(B*97.47)+"Yen");

else if(Choice==11){

System.out.println("Dear user, you are converting from AUD to Naira");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"AUD is equivalent to "+(B*984.07)+"Naira");

else if(Choice==12){

System.out.println("Dear user, you are converting from AUD to Rupee");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"AUD is equivalent to "+(B*53.90)+"Rupee");

else if(Choice==13){

System.out.println("Dear user, you are converting from Yen to USD");

System.out.println("Enter Amount");
int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Yen is equivalent to "+(B*0.0067)+"USD");

else if(Choice==14){

System.out.println("Dear user, you are converting from Yen to AUD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Yen is equivalent to "+(B*0.010)+"AUD");

else if(Choice==15){

System.out.println("Dear user, you are converting from Yen to Naira");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Yen is equivalent to "+(B*10.10)+"Naira");

else if(Choice==16){

System.out.println("Dear user, you are converting from Yen to Rupee");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Yen is equivalent to "+(B*0.55)+"Rupee");

else if(Choice==17){

System.out.println("Dear user, you are converting from Rupee to USD");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Rupee is equivalent to "+(B*0.012)+"USD");

else if(Choice==18){

System.out.println("Dear user, you are converting from Rupee to AUD");


System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Rupee is equivalent to "+(B*0.018)+"AUD");

else if(Choice==19){

System.out.println("Dear user, you are converting from Rupee to Yen");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Rupee is equivalent to "+(B*1.81)+"Yen");

else if(Choice==20){

System.out.println("Dear user, you are converting from Rupee to Naira");

System.out.println("Enter Amount");

int B=sixthPage.nextInt();

System.out.println("Dear user, "+B+"Rupee is equivalent to "+(B*18.28)+"Naira");

static void temperatureConverter(){

Scanner seventhpage=new Scanner(System.in);

System.out.println("Welcome to the temperature conversion page");

System.out.println("To convert from Celcius to Kelvin, Press 1");

System.out.println("To convert from Celcius to Farheniet, Press 2");

System.out.println("To convert from Kelvin to Celcius, Press 3");

System.out.println("To convert from Kelvin to Farheniet, Press 4");

System.out.println("To convert from Farheniet to Celcius, Press 5");

System.out.println("To convert from Farheniet to Kelvin, Press 6");

}
public static void main(String[] args) {

Scanner direct=new Scanner(System.in);

System.out.println("If you are a new user:");

System.out.println("Press 1 to register");

System.out.println("Press 2 to calculate age");

System.out.println("Press 3 to calculate CGPA");

System.out.println("Press 4 to Grade your score");

System.out.println("Press 5 to Grade your score");

System.out.println("Press 6 to access currency converter");

System.out.println("Press 0 to go back to menu");

System.out.println("Enter your choice");

int A=direct.nextInt();

if(A==1){

UserRegistration();}

else if(A==2){

AgeCalculator();}

else if(A==3){

CGPACalculator();}

else if(A==4){

GradingSystem();}

else if(A==6){

CC();

else{

System.out.println("Input between 1-6");

}
}

You might also like