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 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 + "%");
}
}
View Answers
Related Tutorials/Questions & Answers:
what is the rongwhat 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
Advertisements
What is procedureWhat is procedure
What is procedure in computers?
What are the primary categories of procedures
What is IOC ? What is IOC ? HI,
What is IOC or Dependency Injection?
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 SPOOL?What is SPOOL?
What is SPOOL?
SPOOL command stores output to a file
What is CRM?What is CRM? Can anyone tell me
What is CRM?
Thanks
What is webservices?What is webservices?
What is web-services and
what are the different types of web-services? It would be great if someone explain me the difference between these types of web-services in Java
What is Ajax?What is Ajax? Hi,
What is Ajax and
what is use of Ajax in web programming?
Thanks
Hi,
Ajax stands for AJAX stands for Asynchronous... JavaScript and other technologies such as CSS and XML.
Read more at
What is Ajax
What is portalWhat is portal
What is portal
What is portal and how can i create a portal in Java using components like Java and Java servlet?
What are the elements of a portal and how can i create sigle request portal page in Java
What is a tuple?What is a tuple?
What is a tuple?
hi,
A tuple is an instance of data within a relational database.ADS_TO_REPLACE_1
Thanks
What is workflowWhat is workflow hello,
What is workflow in RUP?
hi,ADS_TO_REPLACE_1
A workflow is a sequence of activities that produces a result observable value
what is RUP?what is RUP? hello,
what is RUP??
hii,ADS_TO_REPLACE_1
RUP is stands for Rational Unified Process
What was ENIACWhat was ENIAC
What was ENIAC?
ENIAC was first electronic computer. Full form of ENIAC is Electronic Numerical Integrator And Computer
what is posting?what is posting?
what is posting?
Posting is an event that writes Inserts, Updates & Deletes in the forms to the database but not committing these transactions to the database
What is an Iterator?What is an Iterator? Hi,
What is an Iterator?
Please help me.
Thanks
Hi,
I have find good reference website for the
What is iterator?
In this programming tutorial it explain how to use the iterator interface
What is WSP?What is WSP? hii,
What is WSP?
hello,,ADS_TO_REPLACE_1
Wireless Session Protocol (WSP) implements session services of WAP. Sessions can be connection-oriented and connectionless and they may be suspended
What is CDPD ?What is CDPD ? Hello,
What is CDPD ?
hii,ADS_TO_REPLACE_1
Cellular Digital Packet Data (CDPD) is an open standard for supporting wireless Internet access from cellular devices