Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


dodo zayat
what is the rong
0 Answer(s)      4 years ago
Posted in : Development process


Write a JAVA program to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student. Assume there are 5 questions in the test. Your program should finally print the grade percentage (out of 100%) of each student, and also the class average. Define the exam answer key as Final Array in your program.

i want to know what is the wrong with this program......without changing the style of the code

public class Main {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    double totalpercentage = 0.00;
    double average = 0.00;
    char array[] = { 'a' , 'a' , 'a' , 'a' , 'b' };
    char arr[] = new char[array.length];
    Scanner numofstudents = new Scanner (System.in);
    System.out.println(" Enter number of students ");
    int students = numofstudents.nextInt();



        for ( int i=0; i < students; i++ ){

            for ( int j = i; j <= array.length; j++ ){

            int count = 0;
            arr[j] =(char) Integer.parseInt(JOptionPane.showInputDialog(" enter the answers " + j));

         double percentage =  ( (count /5.0)*100 );
        System.out.println(" Percentage is " + percentage + "%" );

        totalpercentage = totalpercentage + percentage;
            }
        }

        average = totalpercentage / students;
    System.out.println(" class average is " + average + "%");


    }

}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
what is the rong
what is the rong  Write a JAVA program to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each... what is the wrong with this program......without changing the style of the code
what is bit
what is bit  what is bit
Advertisements
What is procedure
What is procedure  What is procedure in computers? What are the primary categories of procedures
what are indices?
what are indices?  what are indices
what is collections?
what is collections?  what is collections
What is this keyword?
What is this keyword?  What is this keyword
what is Savepoint ?
what is Savepoint ?  what is Savepoint
What is a "constraint"?
What is a "constraint"?  What is a "constraint
What is Index?
What is Index?  What is Index
What is SQLLoader?
What is SQLLoader?  What is SQLLoader
What is DML?
What is DML?  What is DML
What is an interface?
What is an interface?  What is an interface
What's PHP ?
What's PHP ?  What's PHP
What is VLR ?
What is VLR ?  hii, What is VLR
What is Trigger?
What is Trigger?  What is Trigger
What is ActionServlet?
What is ActionServlet?  What is ActionServlet
What is FBT
What is FBT   hello, What is FBT
What is JDBC?
What is JDBC?  What is JDBC
What is an Abstract Class and what is it's purpose?
What is an Abstract Class and what is it's purpose?   Hi, What is an Abstract Class and what is it's purpose? Thanks
What is a transaction and what are ACID properties?
What is a transaction and what are ACID properties?  What is a transaction and what are ACID properties
What is DataAccessException?
What is DataAccessException?  Hi, What is DataAccessException? thanks
What is IOC ?
What is IOC ?  HI, What is IOC or Dependency Injection? Thanks
What is SQLExceptionTranslator?
What is SQLExceptionTranslator?  Hi, What is SQLExceptionTranslator? Thanks
What is Externalizable?
What is Externalizable?   Hi, What is Externalizable? Thanks
What is the % operator?
What is the % operator?   Hi, What is the % operator? thanks
What is casting?
What is casting?   Hi, What is casting? thanks
What are Struts?
What are Struts?  What are Struts? Can anyone explain me what are the Struts framework and what are its uses? Thanks
What is WAP?
What is WAP?  What is WAP?   Hi, Check the tutorial: What is WAP? Thanks
What is CRM?
What is CRM?  Can anyone tell me What is CRM? Thanks
what is RUP?
what is RUP?  hello, what is RUP??   hii, RUP is stands for Rational Unified Process
What is a tuple?
What is a tuple?  What is a tuple?   hi, A tuple is an instance of data within a relational database. Thanks
 

 

 

DMCA.com