import [Link].
Scanner;
public class Grade {
public static void main(String[] args) {
double grade;
Scanner read = new Scanner([Link]);
[Link]("Enter Grade ");
grade = [Link]();
if(grade>=90 && grade <=100)
{
[Link](grade+" is equivalent to LETTER GRADE A");
}
if(grade>=80 && grade <=89)
{
[Link](grade+" is equivalent to LETTER GRADE B");
}
if(grade>=70 && grade <=79)
{
[Link](grade+" is equivalent to LETTER GRADE C");
}
if(grade>=60 && grade <=69)
{
[Link](grade+" is equivalent to LETTER GRADE D");
}
if(grade<60)
{
[Link](grade+"is equivalent to LETTER GRADE A");
}
}
}
import [Link];
public class Color {
public static void main(String[] args) {
char code;
Scanner read = new Scanner([Link]);
[Link]("Enter Code ");
code = [Link]().toLowerCase().charAt(0);
if(code=='R' || code=='r');
{
[Link]("\nColor code" + code + "is equivalent to RED");
}
if(code=='G' || code=='g');
{
[Link]("\nColor code" + code + "is equivalent to
GREEN");
}
if(code=='B' || code=='b');
{
[Link]("\nColor code" + code + "is equivalent to BLUE");
}
if(code=='Y' || code=='y');
{
[Link]("\nColor code" + code + "is equivalent to
YELLOW");
}
if(code!='R'&& code!='r'&&
code!='G'&& code!='g'&&
code!='B'&& code!='b'&&
code!='Y'&& code!='y')
{
[Link]("\nColor Code"+code+" is invalid code");
}
}
}
import [Link];
public class Operator {
public static void main(String[] args) {
char option;
double number1, number2, answer;
Scanner read = new Scanner([Link]);
[Link]("\n\t\t\t\t M E N U");
[Link]("\t\t\t---------------------------------");
[Link]("\t\t\t\t[A] Addition");
[Link]("\t\t\t\t[B] Subtraction");
[Link]("\t\t\t\t[C] Multiplication");
[Link]("\t\t\t\t[D] Division");
[Link]("\n\t\t\tSelect an option [A,B,C or D]:");
option = [Link]().charAt(0);
if (option == 'A' || option == 'a') {
[Link]("\n\t\t\tEnter first number: ");
number1 = [Link]();
[Link]("\n\t\t\tEnter second number: ");
number2 = [Link]();
answer = number1 + number2;
[Link]("\n\t\t\tSum: " + answer);
}
if (option == 'B' || option == 'b') {
[Link]("\n\t\t\tEnter first number: ");
number1 = [Link]();
[Link]("\n\t\t\tEnter second number: ");
number2 = [Link]();
answer = number1 - number2;
[Link]("\n\t\t\tDifference: " + answer);
}
if (option == 'C' || option == 'c') {
[Link]("\n\t\t\tEnter first number: ");
number1 = [Link]();
[Link]("\n\t\t\tEnter second number: ");
number2 = [Link]();
answer = number1 * number2;
[Link]("\n\t\t\tProduct: " + answer);
}
if (option == 'D' || option == 'd') {
[Link]("\n\t\t\tEnter first number: ");
number1 = [Link]();
[Link]("\n\t\t\tEnter second number: ");
number2 = [Link]();
answer = number1 / number2;
[Link]("\n\t\t\tQuotient: " + answer);
}
if (option != 'A' && option != 'a' &&
option != 'B' && option != 'b' &&
option != 'C' && option != 'c' &&
option != 'D' && option != 'd') {
[Link]("\n\t\t\tinvalid option");
[Link]("\n\t\t\tValid choices are A,B,c or D only");
}
}
}