marks

marks

the marks obtained by 100 students in a subject are tabulated as fallow:-

NAME MARKS

wap a program to input the names and marks of the students in the subject of computer applications.
calculate the display:-
*average marks in the subject of computer applications/subject average marks=subject total/100).
*the higest marks in the subject and the name of the students (the maximum marks in the subject are 100).
View Answers

March 5, 2010 at 2:52 PM

Hi Friend,

Try the following code:

import java.util.*;

class Student {
String name;
double marks;
public Student(String n, double s){
name = n;
marks = s;
}
public String getName(){
return name;
}
public double getMarks(){
return marks;
}
}
public class ArrayListExample{
public static void main(String[] args){
Scanner input=new Scanner(System.in);
double sum=0;
String name="";
double marks=0;
double maxNumber = Double.MIN_VALUE;
ArrayList<Student> list = new ArrayList<Student>();
for(int i=1;i<=5;i++){
System.out.println("Enter Name: ");
name=input.next();
System.out.println("Enter Marks: ");
marks=input.nextDouble();
sum =sum+marks;
if (marks > maxNumber) {
maxNumber = marks;
}
list.add(new Student(name, marks));
}
double average=sum/5;
System.out.println("Name Marks");
for (Student s : list)
System.out.println(s.getName()+" "+s.getMarks());
System.out.println("Average Marks= "+average);
System.out.println("Highest Marks= "+maxNumber);
System.out.println("Name of Student achieved highest marks= ");
for (Student s : list){
if(maxNumber == s.getMarks()){
System.out.println(s.getName());
}
}
}
}


Thanks









Related Tutorials/Questions & Answers:
Marks
Marks       Giving score to article as Digg does. Read full DescriptionADS_TO_REPLACE_1
Student Marks
marks entered by user and find the grade. Create a simple application which can calculate 5 marks entered by user and find the grade. You must display the grade in a dialog message. You may choose whether to get input (5 marks) from TextField
Advertisements
Student Marks
. (A,B,Cââ?¬Â¦..) Marks for ââ?¬Ë?Computer Programming Assignment 1ââ?¬â?¢ (out of 25 marks) Marks for ââ?¬Ë?Computer Programming Assignment 2ââ?¬â?¢ (out of 25 marks) Marks for ââ?¬Ë?Computer Programming Examââ?¬â?¢ (out of 50 marks
marks - Java Beginners
marks  the marks obtained by 100 students in a subject are tabulated as fallow:- NAME MARKS wap a program to input the names and marks of the students in the subject of computer
array of students with marks list
array of students with marks list  There are 4 array of numbers or scores as below. They are called marks list and represent the scores individual... across all lists and also the number of students (4 in this case). Marks List 1
Java Program for Calculating Marks
that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10 students. The marks consist of two tests, test 1 and test 2. I also need to calculate
Java Program for Calculating Marks
that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10 students. The marks consist of two tests, test 1 and test 2. I also need to calculate
Java Program for Calculating Marks
that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10 students. The marks consist of two tests, test 1 and test 2. I also need to calculate
Java Program for Calculating Marks
that requires me to a write simple java program that will calculate marks for 10 students. I must use an array to ask user to key in the marks for the 10 students. The marks consist of two tests, test 1 and test 2. I also need to calculate
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
program to input marks
program to input marks  program to input marks ,name in computer application 7 annual fees to be paid .Decide the scholarship amount as per the given criteria Marks Scholarship(%)on Annual Fees =90
calculati marks for objective question set?
calculati marks for objective question set?  how to calculate marks for objective question set
ModuleNotFoundError: No module named 'pytest-marks'
ModuleNotFoundError: No module named 'pytest-marks'  Hi, My Python... 'pytest-marks' How to remove the ModuleNotFoundError: No module named 'pytest-marks' error? Thanks   Hi, In your python
student marks sheet genaration in struts frame work
student marks sheet genaration in struts frame work  Hi every body iam using struts frame work back end as oracle 10g xe i wanna urgent code for student marks genaration code please help me thanks in advance
Write a program that takes the marks of user as input
Write a program that takes the marks of user as input  Write a program that takes the marks of user as input. If marks are greater then 60 the program should display "Great, you have passed the course", else the program should
Write a program to display grade message according to the marks
to the marks..........   Here is a code that accepts the number of students and their marks and display the grade according to student's marks... marks: "); double marks = Double.parseDouble(input
Write a JSP program to display the grade of a student by accepting the marks of five subjects.
Write a JSP program to display the grade of a student by accepting the marks of five subjects.  Write a JSP program to display the grade of a student by accepting the marks of five subjects
write a java program to print marklist of n students. input Register number, name and marks of three subjects.
write a java program to print marklist of "n " students. input Register number, name and marks of three subjects.  write a java program to print marklist of "n " students. input Register number, name and marks of three subjects
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?
How to solve this java code by adding the student marks not in the list... marks: "); double marks = Double.parseDouble(input); data[a] = new MarkStudent(); data[a].setTotalMarks(marks); if (marks <
Mysql Alter Foreign Key
Mysql Alter Foreign Key       A Foreign Key is a field that marks to the primary key of another  table. The use of the foreign key is used to ensure referential
Common Interview Questions Page - 7
marks rather you may mention that if you had avoided certain mistakes, perhaps you
JSP - JSP-Servlet
JSP  how to insert marks in oracle8i with jsp
programming - IDE Questions
programming  A student?s marks and status is determined according to the following schedule: Marks Status Greater than or equal to 75 Excellent... than 40 Fail Your program should display the Marks and Status for 5 subjects
i/o
the following information regarding the marks for 10 students in a test i. Matric no ii. Marks for question 1 iii. Marks for question 2 iv. Marks for question 3 v. Marks for question 4 vi. Marks for question 5 vii. Total marks
package - Java Beginners
Creating a package in Java  Create a package called My Package. In this, create a class call Marks that specifies the name of student, the marks in three subjects and the total of these marks. Displays the details of three
poonik
poonik  sir plz tell me the logic in java if we input grades(A,B,C..) in marksheet then automatically it converts our grade into marks (1,2,3..)and giva a total marks in marks format(1,2,3
C/C++ QUESTIONS
marks obtained by a student from an array contained student name and marks". For Example : GetHighestLowestMarks{Student{n}, Marks{n}} returns an arraycontain student name and marks
flowchart and algorithm
++) { System.out.println("Enter marks"); double marks...(marks); if (marks < 40) { data[i].setGrade("E"); } if (marks >= 40 && marks <= 44) { data[i
Please help with this Q
to enter in various marks which students have been awarded, until the tutor enters... should work with any number of student marks entered. After the histogram... { public static void main(String args[]) { float marks[]=new float[20
java
students have marks in theory oracle students have marks in lab,java ee students have marks in theory project .so create constuctors to take all necessary details then provide priny to print all details.provide get marks which returns marks
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
passing data between the jsp pages ?
on student marks system.in this project their is one html page which asks user to enter... .on that jsp page it retrieve marks regarding the particular roll number and displays the marks and i write another jsp which will calculate the percentage
Swing Program
Swing Program  Write a java swing program that takes name and marks as input with all validation. The name and marks will be displayed in message box when user clicks on a button
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
convert this code to GUI
; a++) { System.out.print("Enter student programming marks: "); double marks = input.nextDouble(); data[a] = new StudentGrade(); data[a].setTotalMarks(marks); if (marks < 40
assig
assig  use wrapper classes by implementing a program to calculate the percentage of marks in five courses of an MCA student
How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks
please explain this prog
subjects"); int n= Integer.parseInt(br.readLine()); //create array for marks int marks[]=new int[n]; int tot=0; for(int i=0;i<n;i++){ System.out.println("enter marks:\n"); marks[i]=Integer.parseInt(br.readLine()); } for(int i=0
jsp and java
jsp and java  how to write a jsp and related java code to enter student marks into database
Quries
Quries  a JAVA program to calculate the percentage of a student marks by using java arithmetic operators like +(addition), % (division
Read text file to 2D array and sorting the second column
that the student names with marks in a text file the marks decreases significantly... and the second column is marks in tests.What we need to find is which student marks... are good students if the marks decreases next time again. Then in the next step we can
Please help in drawing Flowchart
with marks in a text file the marks decreases significantly. when exams conducted fast 4 times.THe first column is the student name and the second column is marks in tests.What we need to find is which student marks decreases most often
java
; } public String toString(){ return ("Invalid Marks entered! "+ str...{ Scanner input=new Scanner(System.in); System.out.print("Enter marks: "); int marks=input.nextInt(); if(marks < 15){ throw new

Ads