0% found this document useful (0 votes)
5 views2 pages

Practical No 4

JPR

Uploaded by

Ashish Mavani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Practical No 4

JPR

Uploaded by

Ashish Mavani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Practical No.

: 04

Practical Name: Develop program to demonstrate use of switch case statement and conditional if
(?:)

Roll No.: 63

Student Name: Mavani Ashish Shantilal

Program:

import java.util.Scanner;

class PracticalNo4
{
public static void main(String args[])
{
String grade;
Scanner sc = new Scanner(System.in);
System.out.print("Enter Your Grade: ");
grade = sc.next();
switch (grade)
{
case "A","a","A+","a+":
System.out.println("Distinction");
break;
case "B","b","B+","b+":
System.out.println("First Class");
break;
case "C","c","C+","c+":
System.out.println("Second Class");
break;
case "D","d","D+","d+":
System.out.println("Pass");
break;
default:
System.out.println("Fail");
}
sc.close();
}
}
Output:

You might also like