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




Have Programming Question? Ask it here!
 
 
 


dodo zayat
net beans
1 Answer(s)      3 years and 8 months 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.


Advertisement
View Answers

December 19, 2010 at 7:49 PM


import java.io.*;


public class Test1{

 public static void main(String args[]){
    String ans1="a",ans2="a",ans3="a",ans4="a",ans5="a";
    double totPercentage = 0.00;
    double avgPercentage = 0.00;



    System.out.println("Enter No. Of Students");
    try{
        InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
        String s = br.readLine();
        int n = Integer.parseInt(s);


        for(int i=1;i<=n;i++){
            int count =0;


            System.out.println("Give the answers for student "+i);

            System.out.println("First Question select choice : A B C D");
            String ansr1 = br.readLine();
            if(ansr1.equalsIgnoreCase(ans1))
                count=count+1;
            System.out.println("Second Question select choice : A B C D");
            String ansr2 = br.readLine();
            if(ansr2.equalsIgnoreCase(ans2))
                count=count+1;
            System.out.println("Third Question select choice : A B C D");
            String ansr3 = br.readLine();
            if(ansr3.equalsIgnoreCase(ans3))
                count=count+1;
            System.out.println("Fourth Question select choice : A B C D");
            String ansr4 = br.readLine();
            if(ansr4.equalsIgnoreCase(ans4))
                count=count+1;
            System.out.println("Fifth Question select choice : A B C D");
            String ansr5 = br.readLine();
            if(ansr5.equalsIgnoreCase(ans5))
                count=count+1;


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

            totPercentage =totPercentage+percentage;

        }

        avgPercentage= totPercentage/n;
        System.out.println("Class Avg : "+avgPercentage+"%");

    }
    catch(Exception e){
        e.printStackTrace();
    }
 }

}


Related Tutorials/Questions & Answers:
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
Advertisements
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
net beans
net beans  how to calculate electric bill,units,load in net beans and how to insert this calculated bill ,unit and load into database and how this calculate value comes on GUI
NET BEANS
NET BEANS  My problem is when i am going to install net beans then it showing the problem that JDK6 or JDK5 is required for installing net beans IDE,but in actually I've already installed the jdk5,I do not know why
net beans
net beans  Write a JAVA program to read the values of an NxN matrix and print its inverse
net beans
net beans  Write a JAVA program to parse an array and print the greatest value and the number of occurrences of that value in the array. You can initialize the array random values in the program without the need to read them
net beans
net beans  Write a JAVA program to validate the credit card numbers using Luhn Check algorithm. You will need to search the Internet to understand how the algorithm works.   Hi Friend, Try the following code: import
net beans
net beans  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
NET BEANS - IDE Questions
NET BEANS  hi i am new to net beans and wants to use net beans 6.5 can any body tell me how can i learn completely about it..if any body have resources abt it plz send me at abhishek_sahu05@yahoo.com  Hi i am
net beans 4
net beans 4  Write a JAVA program to read an initial two number x1 and x2, and determine if the two numbers are relatively prime. Two numbers are relatively prime. Two numbers are relatively prime if the only common factor
Where is servlet log file in net beans?
Where is servlet log file in net beans?  When you use context.log("some string"); then the string get written into the servlet log file. But where is the servlet log file in netbeans? I am using netbeans 6.9. I can't locate
jsp directory created in net beans but not able to access
jsp directory created in net beans but not able to access  File f = new File (config.getServletContext().getRealPath("/") + "artists/" +username); f.mkdir(); File video = new File (config.getServletContext().getRealPath
How to add image in panel as background in net beans IDE?
How to add image in panel as background in net beans IDE?  How to add image in panel as background in net beans IDE
java Using net beans - Java Beginners
java Using net beans  Dear Sir, I just like to ask why i cant add a data to the answer you have given me last time where i have to pick the data of the student like id , name , class , age & address using netbeans jframe then i
java Using net beans - Java Beginners
java Using net beans  Dear Sir, I just like to ask why i cant add a data to the answer you have given me last time where i have to pick the data of the student like id , name , class , age & address using netbeans jframe then i
java Using net beans - Java Beginners
java Using net beans  Dear Sir, I just like to ask why i cant add a data to the answer you have given me last time where i have to pick the data of the student like id , name , class , age & address using netbeans jframe then i
how to run audio files in net beans using j2me
how to run audio files in net beans using j2me  i am running the audioMidlet in net beans. Now where should i place the .wav files inorder to play them
sample application using hibernate and wicket framework in net beans IDE
sample application using hibernate and wicket framework in net beans IDE  where can i get sample applications/ projects using hibernate and wicket framework in net beans IDE
Java programming or net beans - Java Beginners
Java programming or net beans  Help with programming in Java? Modify the dog class to include a new instance variable weight (double) and the Cat class to include a new instance variable coatColor (string). Add the corresponding
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT
PROJECT ON JAVA NET BEANS AND MYSQL !! PLEASE HELP URGENT  i need a project based on connectivity..it can be based on any of the following topics 1.for calculating income tax. 2.for pf calculation 3.hospital management 4.students
how to generate PDF file using JSP with net beans
how to generate PDF file using JSP with net beans  I am trying to generate PDF file using JSP. I even added itext5.0.6 jar file in library. It shows the following errors... PLz anyone help me. Its urgent.... compile-jsps
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???  How can change Button Label value Every Time when i start Virtual Keyboard, Means ,if 1st time Button1=''a'' then next login time
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???  How can change Button Label value Every Time when i start Virtual Keyboard, Means ,if 1st time Button1=''a'' then next login time
Wicket on Net Beans IDE
Wicket on Net Beans IDE     ... by step procedure to run Wicket on Net Beans IDE. First of all you must have Wicket Framework on your Net Beans IDE. If you do not have this then install the proper
net_banking
net_banking  hi, I am developing a project on net_banking.. and want to know how to calculate the processing fees on loan(home/vehicle/personal)depending upon loan amount
net beans2
net beans2  Write a JAVA program to find the nearest two points to each other (defined in the 2D-space
sql and .net
sql and .net  I want get coding of connecting data base sql server 2000 to .net please help
.Net - Framework
.Net  i am not getting any dot Net tutorials  hi, http://www.dotnetspider.com/tutorials/AspNet-Tutorials.aspx Thanks
dot net
dot net  how to open a new window having detailed contents by clicking a marquee text in a page(like news details opening on clicking flash news title) in dot net 2003
net banking
net banking  hi.... I am developeing a net banking project...and i want coding for following... this module for new loan application... First Name,Last Name, Salaried /business, Current Organization, Resident Address, Office
Wicket
) and Tapestry frameworks. You can also use the Net Beans IDE for developing... framework: Wicket on Net Beans IDE This tutorial
NET BEAN - IDE Questions
NET BEAN  Thanks for your response actually i am working on struts and other window application. so if you have complete resources abt it then tell me.... and if you have link of this book ""Java EE Development with Net Beans
WebORB for .NET
WebORB for .NET       WebORB for .NET is a platform for developing AJAX and Flash-based rich client application and connecting them with .NET objects and XML Web Services. Read full
Java Beans
Java Beans  hii What is Java Beans?   hello,, A Java Bean is a reusable software component that can be manipulated visually in a builder tool
disadvantages of .net framework - Framework
disadvantages of .net framework  what rae the disadvantages of .net framework
Disadvantages..... of java and .net
Disadvantages..... of java and .net  Disadvantages of Java and .Net
about .net coding
about .net coding  please suggest me the code used for viewing a page in .net language
Enterprise Beans
Enterprise Beans       Enterprise beans are the Java EE server side components that run inside the ejb container... by many users. Enterprise beans are used to perform various types of task like
SQL in dot net
SQL in dot net  write a code in dot net which connects to a database, retrieves the data and allows to input a valid phone number
WebORB for .NET
WebORB for .NET       WebORB for .NET is a platform for developing AJAX and Flash-based rich client application and connecting them with .NET objects and XML Web Services. Read full
java vs .net - Java Beginners
java vs .net  which language is powerful now java or .net
.Net and SQl 2000 Login page
.Net and SQl 2000 Login page  Please help me creating a login page using dot net using data base sql 2000
.NET Programming
.NET Programming .NET Application Development Services from Rose India .NET... .NET framework includes coded solutions and a virtual machine for their implementation. Rose India has been using the Microsoft .NET Framework from its first
.Net dll to Java - Java Beginners
.Net dll to Java  Hi, I've a .Net dll file and need to call into JAVA. Can i get any sample code on this, please? Thanks Chinnapa
java beans - Java Beginners
java beans  how and where are java beans implemented  Hi Friend, Please visit the following links: http://www.roseindia.net/jsp/using-bean-counter.shtml http://www.roseindia.net/jsp/java-bean-example-jsp.shtml
Beans in Swings table
Beans in Swings table  Hi Sir/Madam.... I am Trying Develop an Swing from which include an table which displays the data from mysql table and i am... values so i decided to use beans but the value which i am entering in textfield
Pojo and java beans
Pojo and java beans  Can anyone tell me where we should use pojo class and where we should use beans. We use pojo class to make the object of mapping file in hibernate framework. Can I use pojo class in those applications where
Advertisements
 

 

 

DMCA.com