You are on page 1of 5

1 write the java program for grading system

// Java program to find grade..

import java.util.Scanner;

public class Student {

   public static void main(String[] args) {

      // score (0-100)

      String grade = null;

      System.out.print("Enter a number: ");

      Scanner sc = new Scanner(System.in);

      int score = sc.nextInt(); // Taking value from user at run time

      switch(score/10)

      {

        // for >= 90

        case 10:

        case 9:

           grade = "A";

           break;

        // for >= 80 and <90

        case 8:

           grade = "B";

           break;

        // for >= 70 and <80

        case 7:

           grade = "C";


           break;

        // for >= 60 and <70

        case 6:

           grade = "D";

           break;

        // for >= 50 and <60

        case 5:

           grade = "E";

           break;

        // for < 50

        default:

           grade = "F";

           break;

      }

      // displaying result...

      System.out.println("Your Grade is  = " + grade);

   }

}
2

3 write the java program that compute a fibonnacci series


import java.util.*;

public class Main

static int n1=0,n2=1,n3=0;

//Prints Fibonacci Series using Recursion

static void printFibonacci(int n)

if(n>0)

n3 = n1 + n2;

System.out.print(" "+n3);

n1 = n2;

n2 = n3;

printFibonacci(n-1);

public static void main(String args[])

//Take input from the user

//Create instance of the Scanner class


Scanner sc=new Scanner(System.in);

System.out.print("Enter the number of terms: ");

int n=sc.nextInt(); //Declare and Initialize the number


of terms

System.out.print("Fibonacci Series up to "+n+" terms: ");

System.out.print(n1+" "+n2);//printing 0 and 1

printFibonacci(n-2);

4 Lexical Rule
(Redirected from lexical rule)

A Lexical Rule is a Rule within a Lexicon.

 Context:
o It can be associated to a Lexical Rule Instantiation.
o It can build a new word in the Lexicon.
o It can be a Word-Formation Rule (which forms words out of Word Bases and
Affixes.
 Example(s):
o Inflection (Lexical Rule) (lexeme-to-word),
o Derivation (Lexical Rule) (lexeme-to-lexeme,
o Post-Inflection (Lexical Rule) (word-to-word),
 Counter-Example(s):
o Post-Lexical Rule,
o Morphological Rule.
 See: Lexeme, Lexical Record, Lexical Unit, Part-of-Speech, Morphological Rule, Word
Formation Process, Morphological Processing, Morphological Compounding Rule,
Compound Word Generation Process, Word Sense Disambiguation

You might also like