siti umairah
how to solve this..
Posted in : Java Beginners

Given a list of students and their marks

Name | Science | Math | English | Computer

Ahmad | 28 | 100 | 66 | 34

Samad | 56 | 89 | 55 | 55

Johan | 78 | 77 | 34 | 100

John | 100 | 43 | 10 | 98

Suhana | 10 | 63 | 21 | 88

A = 100 - 90

B = 89 - 70

C = 69 - 50

D = 49 - 40

F = 39 - 0

Create an array for students and two dimensional arrays for the marks. From this creation get :

a. Convert marks to grade for each marks of the subjects

b. List the student name that gets the highest in that class.

c. List the student name that gets the highest in that class.

d. List of student that get 100 in each subject.

April 25, 2011 at 1:02 PM

```public class Student {
String name;
int sub1;
int sub2;
int sub3;
int sub4;
int totalMarks;

public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
}

public void setSub1(int sub1) {
this.sub1 = sub1;
}

public int getSub1() {
return sub1;
}

public void setSub2(int sub2) {
this.sub2 = sub2;
}

public int getSub2() {
return sub2;
}

public void setSub3(int sub3) {
this.sub3 = sub3;
}

public int getSub3() {
return sub3;
}

public void setSub4(int sub4) {
this.sub4 = sub4;
}

public int getSub4() {
return sub4;
}

public void setTotalMarks(int totalMarks) {
this.totalMarks = totalMarks;
}

public int getTotalMarks() {
}

public static String setGrades(int marks) {
if (marks >= 90 && marks <= 100) {
return "A";
}
if (marks >= 70 && marks <= 89) {
return "B";
}
if (marks >= 50 && marks <= 69) {
return "C";
}
if (marks >= 40 && marks <= 49) {
return "D";
}
if (marks < 40) {
return "F";
}
return " ";
}
```

April 25, 2011 at 1:03 PM

continue..

```public static void main(String[] args) {
int mm = Integer.MIN_VALUE;
Student data[] = new Student[5];
data[0] = new Student();
data[0].setSub1(28);
data[0].setSub2(100);
data[0].setSub3(66);
data[0].setSub4(34);
int sum1 = data[0].getSub1() + data[0].getSub2() + data[0].getSub3()
+ data[0].getSub4();
data[0].setTotalMarks(sum1);

data[1] = new Student();
data[1].setSub1(56);
data[1].setSub2(89);
data[1].setSub3(55);
data[1].setSub4(55);
int sum2 = data[1].getSub1() + data[1].getSub2() + data[1].getSub3()
+ data[1].getSub4();
data[1].setTotalMarks(sum2);

data[2] = new Student();
data[2].setName("Johan");
data[2].setSub1(78);
data[2].setSub2(77);
data[2].setSub3(34);
data[2].setSub4(100);
int sum3 = data[2].getSub1() + data[2].getSub2() + data[2].getSub3()
+ data[2].getSub4();
data[2].setTotalMarks(sum3);

data[3] = new Student();
data[3].setName("John");
data[3].setSub1(100);
data[3].setSub2(43);
data[3].setSub3(10);
data[3].setSub4(98);
int sum4 = data[3].getSub1() + data[3].getSub2() + data[3].getSub3()
+ data[3].getSub4();
data[3].setTotalMarks(sum1);

data[4] = new Student();
data[4].setName("Suhana");
data[4].setSub1(10);
data[4].setSub2(63);
data[4].setSub3(21);
data[4].setSub4(88);
int sum5 = data[4].getSub1() + data[4].getSub2() + data[4].getSub3()
+ data[4].getSub4();
data[4].setTotalMarks(sum1);

for (int i = 0; i < 5; i++) {
Student show = data[i];
System.out.println(show.getName() + "\t "
}
for (int i = 0; i < 5; i++) {
int m = data[i].getTotalMarks();
if (m > mm) {
mm = m;
}
}
System.out.println("Student obtains highest marks: ");
for (int i = 0; i < 5; i++) {
if (mm == data[i].getTotalMarks()) {
System.out.println(data[i].getName() + " "
+ data[i].getTotalMarks());
}
}
System.out.println("Student get 100 marks in each subject: ");
for (int i = 0; i < 5; i++) {
if ((data[i].getSub1() == 100) && (data[i].getSub2() == 100)
&& (data[i].getSub3() == 100) && (data[i].getSub4() == 100)) {
System.out.println(data[i].getName());
} else {
}
}
}
}
```

how to solve
how to solve   log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
How to solve the Hibernate Common Exceptions?
How to solve the Hibernate Common Exceptions?  How to solve the Hibernate Common Exceptions
i dont no how to solve it pls
i dont no how to solve it pls   Calculate and display the sum of all prime number from 1 to 100 covert in java system codes
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0... how to implement
Solve it
Solve it  How to calculate the value which contains oparator and operand both using command line argument
how to solve this problem for oracle connectivity
how to solve this problem for oracle connectivity  Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap ter could not establish the connection
How to Solve the Syntax Error in java??
How to Solve the Syntax Error in java??  Syntax error in java? i have tried this program its showing error like this in Eclipse "Syntax error... of the program "objectname.i" What is the reason for this error??How to access the variable
how do i solve this problem?
how do i solve this problem?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access
how do i solve this question?
how do i solve this question?  1.Define a class named Circle with the following properties: a) An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier
how should i can solve
how should i can solve  Web based program - Input - Person's contact details with Passport Number as Unique Key. Save data in to oracle / MySQL. Output - List of Persons saved in the database. Technology to be used - JSP
solve this
solve this   Create a student class. The student object should have studentid, studentname, subject and marks as properties. Also generate the getter and setter methods. Create 5 objects of this class and populate values
Small Bug How to solve in my code
Small Bug How to solve in my code  String season=""; pst = con.prepareStatement("SELECT DISTINCT(Season) season FROM specialdates where Regid...") + ","; it shows bug in findbugs tool.. but it executes successfully how to solve
how to solve 'Stop Running This Script' Error ?
how to solve 'Stop Running This Script' Error ?  Hi.. When opened the page on IE browser(version : 8.0),it gives an java script error (i.e.Stop Running This Script). I have used jsp/servlet for this. Please help to resolved
how to solve this kind of error in Eclipse IDE?
how to solve this kind of error in Eclipse IDE?   i'm creating the Simple CRUD Using Jsp, Servlet and MySQL program and i'm using the eclipse, and i all most done it, finally i'm going to run myself, it can't be run. i
how to solve the nullPointer Exception in main - Java Beginners
how to solve the nullPointer Exception in main  New to Java ,pls help me how fix Null pointer Exception in main: two files , split .java another is actualState1.java , I want to get value of spaceWord[1] from split.java
How to solve button problem - Java Beginners
How to solve button problem  I have created button (Open File Dialog... equal space So button size also increasing. Could you please guide me how to solve this problem. Thank you Sir, Yours truly, T.Ramesh Puttaparthy
how to solve error like'java.lang.NumberFormatException: For input string: "7600113411"' this
how to solve error like'java.lang.NumberFormatException: For input string: "7600113411"' this  java.lang.NumberFormatException: For input string: "7600113411"    java.lang.NumberFormatException: For input string
solve this pbm
solve this pbm  sir rows are also inserting i have checked in the database also the rows are not affected in the table . The first pbm wich i have sent to you is not yet solved.......... pls give me detail explaination how we
solve this pbm
solve this pbm  its not working the code for databae access using servlets
How to solve concurrency issue when an application is running on two machine to fetch record from one database
How to solve concurrency issue when an application is running on two machine to fetch record from one database  I have developed an application in java to run on two machines. Program will fetch a record from database and process
solve this problem
solve this problem  I typed this program and compiled.The program is compiled but when i eneterd url in tomcat server. Its not giving error but only blank page is coming the text is not displaying and row is also inserted
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 of the table. For example -10 and 156 in GUI?  import java.awt.*; import javax.swing.*; import java.awt.event.*; public class MarkStudent { double
A Program To Solve In Java
A Program To Solve In Java  x!/x+(x+2)!/x+(x+4)!/x ... (x+n)!/x
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <html> <script language="javascript" > function removeAllItems(selectbox
help me to solve this question
help me to solve this question  Write a program that inputs a series of integers into an array. The numbers are in the range 0 to 100. Calculate and display : a) The Largest number b) The Smallest Number c)The sum of the numbers
solve it - Java Beginners
solve it  Hi friend, I want to use switch case in jsp please let me know how to call page in jsp using include tag i want call this file using include tag please help me use switch statement in jsp
to solve the error - Java Beginners
to solve the error  class bubbleSort1{ public static void...++) { // count how many times // This next loop becomes shorter and shorter for (int i=0...; pass++) { // count how many times // This next loop becomes shorter