0% found this document useful (0 votes)
41 views

1 Write The Java Program For Grading System

The document contains two Java programs. The first program takes a test score as input and returns a letter grade by mapping score ranges to grades. The second program prints the Fibonacci series up to a given number of terms by recursively calling a printFibonacci method.

Uploaded by

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

1 Write The Java Program For Grading System

The document contains two Java programs. The first program takes a test score as input and returns a letter grade by mapping score ranges to grades. The second program prints the Fibonacci series up to a given number of terms by recursively calling a printFibonacci method.

Uploaded by

adisu abuhoy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy