toll_booth1

Upload: anju-jayanthan

Post on 08-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 toll_booth1

    1/34

    TOLL BOOTH

    NAME : Jibin joseph

    CLASS : ElectronicsLECTURER : Mrs.Amutha

    TEMASEK ENGINEERING

    SCHOOL TEMASEK

    POLYTECHNIC

    2008-2009

    ESE1005/C OM PUTER PROGRAM ING

  • 8/7/2019 toll_booth1

    2/34

    0

  • 8/7/2019 toll_booth1

    3/34

    SEMESTER-II

    NAME - JIBIN JOSEPH

    ROLL-NUMBER - 08ELN010

    PROJECT TOLL BOOTH

    2008-2009

    DIPLOMA IN ELECTRONICS

    1

  • 8/7/2019 toll_booth1

    4/34

    BONAFIDE CERTIFICATE

    This is to certify that the project work entitled Toll Booth Programme

    is a bonafide work done by Jibin joseph, belongs to diploma in Electronics.

    This project is submitted for second semester examinations which were

    conducted in SRM Engineering College.

    Date internal examiner external examiner

    2

  • 8/7/2019 toll_booth1

    5/34

    CONTENTS

    Sl No Contents Page No

    1. Bonafied Certificate 2

    2. Acknowledgement 4

    3. Preface 5

    4. 1. Objectives 6

    5. 1.1 Problem statements 66. 1.2 Analysis 6

    7. 2. Project design 7

    8. 2.1 Data requirement 7

    9. 2.2 Problem output 8

    10. 3. Implementation 10

    11. 3.1 Algorithm 10

    12. 3.2 Flow chart 12

    13. 3.3 Source code 20

    14. 4. Conclusion 24

    3

  • 8/7/2019 toll_booth1

    6/34

    AC KNOWLEDGEMENT

    I wish to express my deep sense of gratitude to my lecturer Mrs. Amutha for her

    valuable guidelines. I thank her to going through my rough work and suggesting

    improvements.

    I would like to take this opportunity to express my appreciation to my

    lecturers and lab assistant Mr. Yuvraj for their valuable contributions to and

    assistance with my project. I would like to express my sincere thanks to my sister

    and brother for their suggestions and contributions.

    I extend my thanks to my classmates and friends who gave full co-operations

    with me in the whole time.

    4

  • 8/7/2019 toll_booth1

    7/34

    PR EFACE

    In second semester of Diploma in Electronics course the commonly used computer

    language is Java. The particular project helped us a lot to be an efficient in java

    programming. This project is designed for acquiring more about the java

    programming concepts and methodology.

    This project TOLL BOOTH is created in order to print

    details of the toll fee of different types of vechiles.

    This project has been evacuated using all possible operations of the java language.

    This project was really challenging for me. I tried to be in maximum simplicity as

    possible. I hope that you would like this project.

    5

  • 8/7/2019 toll_booth1

    8/34

    1. Objectives

    Progress Report

    1.1 Problem Statement

    Through this project I have intended to create a programme, which would be useful

    in school office to determine the total mark, grade and percentage scored by a

    student.

    1.2 Analysis

    Total mark, percentage and grade can be calculated using the data entering by the

    user. The method used for the calculation is defined below

    for(int i=1;i=80)

    {Grade[i]="A";

    }else if(Percentage[i]=70)

    {Grade[i]="B";

    }

    else

    {Grade[i]="C";

    }

    System.out.println(i+"\t"+Studentname[i]+"\t\t"+English[i]+"\t"+Syriac[i]+"\t\t"+Physics[i]+"\t"+Chemis

    try[i]+"\t\t"+Biology[i]+"\t"+Mathematics[i]+"\t\t"+Totalmarks[i]+"\t\t"+fmt.format(Percentage[i])+"\t\t"

    +Grade[i]);

    }

    6

  • 8/7/2019 toll_booth1

    9/34

    2. Project Design

    2.1 Data Requirements

    There are certain requirements needed from the user to calculate the total

    mark, percentage and grade scored by a student. The Progress Report enquires the

    user to give valid details regarding the questions. The enquired questions by the

    Progress Report are as follows:

    Enter total no. of students [max.50]:

    Serial no: 1Enter Student name:

    Enter Admission no.(max.7 digits):Enter the marks of English in 100 :

    Enter the marks of Syriac in 100:

    Enter the marks of Physics in 100:

    Enter the marks of Chemistry in 100:Enter the marks of Biology in 100:

    Enter the marks of Mathematics in 100:

    Serial no: 2Enter Student name:

    Enter Admission no.(max.7 digits):Enter the marks of English in 100:

    Enter the marks of Syriac in 100:

    Enter the marks of Physics in 100:Enter the marks of Chemistry in 100:

    Enter the marks of Biology in 100:

    Enter the marks of Mathematics in 100:

    Based on the valid information given by the user for the prompted questions, theprocess of Progress Report is executed

    7

  • 8/7/2019 toll_booth1

    10/34

  • 8/7/2019 toll_booth1

    11/34

    Progress Report

    ===============

    1) Enter student info and mark info.2) Display Total Marks.

    3) Exit.

    Please select 1,2 or 3 :2

    Sl.no. Name English Syriac Physics Chemistry Biology Mathematics Totalmark Percentage Grade

    ------ ---- ------- ---------- ------- --------- ------- ----------- --------- ---------- -----1 anju 98.0 9.0 12.0 11.0 67.0 65.0 262.0 43.67 C2 jitto 90.0 90.0 98.0 97.0 96.0 89.0 560.0 93.33 A

    Progress Report

    ===============

    1) Enter student info and mark info.2) Display Total Marks.

    3) Exit.

    Please select 1,2 or 3 :3You have exited the Progress Report

    Thank you for using the program.

    Process completed.

    9

  • 8/7/2019 toll_booth1

    12/34

    3. Implementation

    3.1 Algorithm

    Step 1.

    The Menu for the Program

    Progress Report===============

    1) Enter student info and mark info.2) Display Total Marks.

    3) Exit.

    Please select 1,2 or 3 :

    Step 2.

    The choice 1 welcomes the user to Enter Mark. User is notified to enter the

    number of students. After the users valid input, the system will enquire for Name,

    Admission No and marks for all the subjects. Then it returns to main menu.The

    working choice 1 is shown below.

    Please select 1,2 or 3 : 1

    Enter total no. of students [max.50]: 2

    Serial no:1

    Enter Student name: anjuEnter Admission no.(max.7 digits): 09

    Enter the marks of English in 100 : 98Enter the marks of Syriac in 100: 9

    Enter the marks of Physics in 100: 12

    Enter the marks of Chemistry in 100: 11

    Enter the marks of Biology in 100: 67

    Enter the marks of Mathematics in 100: 65

    10

  • 8/7/2019 toll_booth1

    13/34

    Serial no: 2

    Enter Student name: jitto

    Enter Admission no.(max.7 digits): 99

    Enter the marks of English in 100 : 90

    Enter the marks of Syriac in 100: 90Enter the marks of Physics in 100: 98

    Enter the marks of Chemistry in 100: 97Enter the marks of Biology in 100: 96

    Enter the marks of Mathematics in 100: 89

    The Main Menu is displayed after the completion of Program.

    Step 3.

    The choice 2 welcomes the user to Display total marks. After the entry of

    choice the program will display the output. Then it returns to main menu

    Please select 1,2 or 3 :2

    Sl.no. Name English Syriac Physics Chemistry Biology Mathematics Totalmark Percentage Grade

    ------ ---- ------- ------- ------- --------- ------- ----------- --------- --------- -----1 anju 98.0 9.0 12.0 11.0 67.0 65.0 262.0 43.67 C

    2 jitto 90.0 90.0 98.0 97.0 96.0 89.0 560.0 93.33 A

    Step 4.

    The choice 3 will Exit the programme. The acknowledgement for using the

    program is shown here.

    Please select 1, 2 or 3: 3

    You have exited the Progress Report

    Thank you for using the program.

    Process completed.

    Step 5.

    If the choice is default (neither 1,2 or 3), the output is defined below

    Please select 1, 2 or 3: 4

    Invalid choice please enter 1, 2, or 3

    11

  • 8/7/2019 toll_booth1

    14/34

    Flow chart of main method

    3.2

    START

    Declare andinitialise static int

    choice,students;static int serial[60];static String Studentname [60];static int Adminno[60]; static doubleEnglish [60]; staticdouble Syriac [60];static doublePhysics [60]; staticdouble Chemistry[60]; static double

    Biology [60];static doubleMathematics [60];static doubleTotalmarks [60]; staticdouble Percentage[60];

    Call for main method

    D

    " ProgressReport "

    =============== "

    " 1) Enter student info andmark info. " " 2) DisplayTotal Marks. "

    " 3)Exit "

    " Please select 1, 2

    or 3 " input choice

  • 8/7/2019 toll_booth1

    15/34

    X

    12

  • 8/7/2019 toll_booth1

    16/34

    X

    default Choice=? 3

    12

    Call for

    markentry

    Call for percentage

    display

    Invalid choice please

    enter 1, 2, or 3

    you have exited theprogress

    report

    Thankyou for

    using the

    program

    D

    END

  • 8/7/2019 toll_booth1

    17/34

    13

  • 8/7/2019 toll_booth1

    18/34

    Flow chart for void method markEntry()

    STA

    RT

    Enter total number of students [max50]:

    input students

    i=1

    J

    i

  • 8/7/2019 toll_booth1

    19/34

    Z

    14

  • 8/7/2019 toll_booth1

    20/34

    Z

    English[i

    ]>100

    false

    truePlease enter the

    marks in 100 enter

    the marks of English in

    100

    input English[i]

    Enter the marks of syriac in 100

    Input syriac[i]

    Syriac[i]>

    100

    false

    true

    Please enter the

    marks in 100 enter

    the marks of Syriac in

    100

    input syriac[i]

    Enter the marks of Physics in 100

    input Physics[i]

    G15

  • 8/7/2019 toll_booth1

    21/34

    G

    Physics[

    i]>100

    false

    true

    Please enter the

    marks in 100 enter

    the marks of Physics in

    100

    input Physics[i]

    Enter the marks of Chemistry in100

    input Chemistry[i]

    Chemistry[

    i]>100

    false

    true

    Please enter the

    marks in 100 enter

    the marks of Chemistry

    in

    100

    input Chemistry[i]

    Enter the marks of Biology in 100

    input Biology[i]

    L

  • 8/7/2019 toll_booth1

    22/34

    16

  • 8/7/2019 toll_booth1

    23/34

    L

    Biology[i]>

    100false

    true

    Please enter the

    marks in 100 enter

    the marks of Biology in

    100

    input Biology[i]

    Enter the marks of Mathematics in

    100

    input Mathematics[i]

    Mathematics

    [i]>100

    false

    true

    Please enter the

    marks in 100 Enter

    the marks of

    Mathematics in 100

    input Mathematics[i]

    i++

    J

  • 8/7/2019 toll_booth1

    24/34

    17

  • 8/7/2019 toll_booth1

    25/34

    Flow chart for void method percentageDisplay();

    START

    "

    Sl.no.\tName\t\tEnglish\tSyriac\tPhysics\tC

    hemistry\tBiol

    ogy\tMathematics\tTotalmark\tPercentage\

    tGrade"

    ------\t----\t\t-------\t----------\t-------\t---------\t-------\t--------

    ---\t---------\t----------\t-----"

    i=1

    i

  • 8/7/2019 toll_booth1

    26/34

    18

  • 8/7/2019 toll_booth1

    27/34

    S

    Percentage[i]>=

    80

    true

    Grade[i]="A";

    false

    true Percentage[i]

    =70

    Grade[i]="B"

    false

    Grade[i]="C"

    i+"\t"+Studentname[i]+"\t\t"+English[i]+"\t"+Syriac[i]+"\t\t"+Physics[i]+"

    \t"+Chemistry[i]+"\t\t"+Biology[i]+"\t"+Mathematics[i]+"\t\t"+Totalmark

    s[i]+"\t\t"+fmt.format(Percentage[i])+"\t\t"+Grade[i]

  • 8/7/2019 toll_booth1

    28/34

    19

  • 8/7/2019 toll_booth1

    29/34

    3.3 Source Code

    /*

    *Name: JITTO K.GEORGE

    *Adm no: 08aprmtn006

    *Class: MECHATRONICS*Program to store marks of students and display the total percentage and grade.

    */

    import java.io.*;//importing package for data input stream

    import java.util.*;

    import java.text.*;//import package for decimal format

    public class Progress_report

    {

    Mathematic

    s marks

    static int choice,students;

    static int[] serial = new int[60];//Aray to store the serial no

    static String[] Studentname = new String[60];//Aray to store the student name

    static int[] Adminno = new int[60];//Aray to store the admission no

    static double[] English = new double[60];//Aray to store the marks of Englishstatic double[] Syriac = new double[60];//Aray to store the marks of Tamil or Hindi

    static double[] Physics = new double[60];//Aray to store the marks of Physics

    static double[] Chemistry = new double[60];//Aray to store the marks of Chemistry

    static double[] Biology = new double[60];//Aray to store the marks of Biology

    static double[] Mathematics = new double[60];//Aray to store the marks of

    static double[] Totalmarks = new double[60];//Aray to store the marks of total

    static double[] Percentage = new double[60];//Aray to store the percentage of marks

    static String[] Grade = new String[60];//Aray to store the grade of student

    static DecimalFormat fmt=new DecimalFormat("00.00");//limit to 2 decimal places

    public static void main(String[] args) throws IOException//main method

    {

    Scanner input=new Scanner(System.in);

    do{

    System.out.println(" \t\t\tProgress Report ");System.out.println("\t\t\t===============");

    System.out.println("1) Enter student info and mark info.");

    System.out.println("2) Display Total Marks.");

    System.out.println("3) Exit.\n");System.out.print("Please select 1,2 or 3 :");

    choice =input.nextInt();

    20

  • 8/7/2019 toll_booth1

    30/34

    switch (choice)

    {

    case 1: markEntry();//invoking markEntry method

    break;

    case 2: percentageDisplay();//invoking percentageDisplay method

    break;

    case 3: System.out.println("You have exited the Progress Report");System.out.println(" ");

    System.out.println("Thank you for using the program.");

    break;

    default:System.out.println("Invalid choice. Please enter 1,2 or 3\n");

    }// end of switch-case

    }while(choice!=3);

    }

    static void markEntry()throws IOException//method to enter the marks{

    Scanner input=new Scanner(System.in);System.out.print("\nEnter total no. of students [max.50]:");

    students = input.nextInt();//to get the no. of students

    for (int i=1; i100)

    {System.out.println("\nPlease enter the marks in 100.\n");

    System.out.print("Enter the marks of Syriac in 100:");

    Syriac[i] = input.nextDouble();}

    21

  • 8/7/2019 toll_booth1

    31/34

    System.out.print("Enter the marks of Physics in 100:");

    Physics[i] = input.nextDouble();//to get the marks of physics

    while(Physics[i]>100)

    {

    System.out.println("\nPlease enter the marks in 100.\n");System.out.print("Enter the marks of Physics in 100:");

    Physics[i] = input.nextDouble();

    }

    System.out.print("Enter the marks of Chemistry in 100:");

    Chemistry[i] =input.nextDouble();//to get the marks of chemistry

    while(Chemistry[i]>100)

    {

    System.out.println("\nPlease enter the marks in 100.\n");

    System.out.print("Enter the marks of Chemistry in 100:");Chemistry[i] = input.nextDouble();

    }

    System.out.print("Enter the marks of Biology in 100:");Biology[i] = input.nextDouble();//to get the marks of biology

    while(Biology[i]>100)

    {

    System.out.println("\nPlease enter the marks in 100.\n");

    System.out.print("Enter the marks of Biology in 100:");

    Biology[i] = input.nextDouble();

    }System.out.print("Enter the marks of Mathematics in 100:");

    Mathematics[i] = input.nextDouble();//to get the marks of mathematics

    while(Mathematics[i]>100)

    {

    System.out.println("\nPlease enter the marks in 100.\n");System.out.print("Enter the marks of Mathematics in 100:");

    Mathematics[i] = input.nextDouble();

    }

    }

    }

    22

  • 8/7/2019 toll_booth1

    32/34

    static void percentageDisplay()throws IOException//method to display total percentage

    {

    Scanner input=new Scanner(System.in);

    System.out.println("

    Sl.no.\tName\t\tEnglish\tSyriac\tPhysics\tChemistry\tBiology\tMathematics\tTotalmark\tPercentag

    e\tGrade");System.out.println(" ------\t----\t\t-------\t----------\t-------\t---------\t-------\t----------

    -\t---------\t----------\t-----");

    for(int i=1;i=80)//if loop to display Grade of the student

    {

    Grade[i]="A";}

    else if(Percentage[i]=70)

    {Grade[i]="B";

    }

    else

    {

    Grade[i]="C";

    }

    System.out.println(i+"\t"+Studentname[i]+"\t\t"+English[i]+"\t"+Syriac[i]+"\t\t"+Physics[i]+"\t"

    +Chemistry[i]+"\t\t"+Biology[i]+"\t"+Mathematics[i]+"\t\t"+Totalmarks[i]+"\t\t"+fmt.format(Percentage[i])+"\t\t"+Grade[i]);

    }

    }//end of main() method

    }//end of class Marks

    23

  • 8/7/2019 toll_booth1

    33/34

    4. Conclusion

    The Progress Report is an effective tool for determining total mark and

    grade of students. Using this programme we can find the percentage of marks with

    a very less effort. In future this project can be extended by adding several features

    to make it convenient.

    24

  • 8/7/2019 toll_booth1

    34/34