Home Answers Viewqa Java-Beginners answer me this program

 
 


Raghavendra Aditya T
answer me this program
1 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners

Java Code to Maintain student record,Name, Age, Marks of 5 subjects for a Student,Display Student age and name,Calculate Average of all marks and display it

View Answers

March 3, 2011 at 12:26 PM


Java student record

import java.util.*;

public class StudentExample{
String name;
int age;
int sub1;
int sub2;
int sub3;
int sub4;
int sub5;
int totalMarks;
int average;
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
public void setAge(int age){
this.age=age;
}
public int getAge(){
return age;
}
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 double getSub4(){
return sub4;
}
public void setSub5(int sub5){
this.sub5=sub5;
}
public int getSub5(){
return sub5;
}
public void setTotalMarks(int totalMarks){
this.totalMarks=totalMarks;
}
public int getTotalMarks(){
return totalMarks;
}
public void setAverage(int average){
this.average=average;
}
public int getAverage(){
return average;
}
public static void main(String[]args){
Scanner input=new Scanner(System.in);
StudentExample data[]=new StudentExample[2];
for (int i=0; i<data.length; i++) {
System.out.println("Enter Name");
String name=input.next();
System.out.println("Enter Age");
int age=input.nextInt();
System.out.println("Enter marks of subject 1");
int m1=input.nextInt();
System.out.println("Enter marks of subject 2");
int m2=input.nextInt();
System.out.println("Enter marks of subject 3");
int m3=input.nextInt();
System.out.println("Enter marks of subject 4");
int m4=input.nextInt();
System.out.println("Enter marks of subject 5");
int m5=input.nextInt();
int tm=m1+m2+m3+m4+m5;
int avg=tm/5;
data[i] = new StudentExample();
data[i].setName(name);
data[i].setAge(age);
data[i].setSub1(m1);
data[i].setSub2(m2);
data[i].setSub3(m3);
data[i].setSub4(m4);
data[i].setSub5(m5);
data[i].setTotalMarks(tm);
data[i].setAverage(avg);
}
System.out.println();
System.out.println("Student Information");
for(int i=0;i<2;i++){
StudentExample show = data[i];
String name=show.getName();
int age=show.getAge();
int m1=show.getSub1();
int m2=show.getSub1();
int m3=show.getSub1();
int m4=show.getSub1();
int m5=show.getSub1();
int tm=show.getTotalMarks();
int avg = show.getAverage();
System.out.println(name + " \t " + age + "\t " + m1+"\t "+m2+"\t "+m3+"\t "+m4+"\t "+m5+"\t "+tm+"\t "+avg);
}
}
}









Related Pages:
answer me this program
answer me this program  Java Code to Maintain student record,Name, Age, Marks of 5 subjects for a Student,Display Student age and name,Calculate Average of all marks and display it   Java student record import
answer me this program
answer me this program  Java Code to Maintain student record,Name, Age, Marks of 5 subjects for a Student,Display Student age and name,Calculate Average of all marks and display it   Java student record import
please i want someone to answer me pleeeeeeeeeeeeease...
please i want someone to answer me pleeeeeeeeeeeeease...    Write a JAVA program using 2D array to auto-grade exams. For a class of N students, your... answer key as Final Array in your program.( using 2D array
Please give me the answer.
"int a=08 or 09" its giving compile time error why   "int a=08 or 09" its giving compile time error why ? can any one give me the answer of this please
please answer me
please answer me  iam using html in select tag.in this one option i selected and that option data will be display in table.And use servlet with html and how to retrieve the data from data base
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
GIVE ME A ANSWER
GIVE ME A ANSWER  Discuss the Number Class in the java.lang package   Number class is an abstract class extended by all classes that represent numeric primitive types such as Byte, Short, Integer, Long, Float
hello sir, please give me answer - Java Beginners
hello sir, please give me answer  Write a program in Java... please tell me full solution of this program   Here is your complete program:File name :count.java---------------------import java.io.*;class count
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
please send me the answer - JDBC
please send me the answer -difference between DriverManager and DataDourse   what is Datasourse? What r the advantages? what is the difference between DriverManager and DataDourse
Please answer me - JSP-Servlet
Please answer me  Hello Guys, this is the third time I'm sending this question. But I've not got the right answer from you. The again is: I need java... 2000 NOT MySQL. Please assist me and for other questions I've asked before
Plz send me answer quckly
Plz send me answer quckly  Respected Sir, myself is pavan shrivastava.i want ask a question that is ( we can't create object of interface then how would possible to create object
java.please answer this...
java.please answer this...   Q1).How we can write a complete JAVA program that computes the following summation formulas..? â??_(i=1)^nâ??ã??i^2=ã?? (n^(2 ) ã??(n+1)ã??^2)/4
Answer me ASAP, Thanks, very important
Answer me ASAP, Thanks, very important  Sir, how to fix this problem in mysql i have an error of "Too many connections" message from Mysql server,, ASAP please...Thanks in Advance
What is the answer and how the program work?
What is the answer and how the program work?  public class Threads2 implements Runnable { public void run() { System.out.println("run."); throw... is the out put of the program
plz. answer my ques - Java Beginners
plz. answer my ques  I want to ask a prog. prob which would create... such type of program is possible in c.  can you mention technology... was given by me just follow 2nd logic which contains two jsp fils "retry.jsp
Answer for SCJP Module-1 Question-13
Answer for SCJP Module-1 Question-13  The Answer for SCJP Module-1 Question-13 is missing , I think the answer is option '1', Correct me if I am wrong
how to get following answer in turbo c program
how to get following answer in turbo c program  input 123456789 output 1 2 3 4 5 6 7 8 9
pls give me answer ae soon as possible - Ajax
pls give me answer ae soon as possible  i m writing code of ajax technology ...but it is not working pls check it n give me response quickly... give me quick response!!! thanks & regards shashank gupta
need the answer vry urgently..plz help me...[plzzzzzzzz
need the answer vry urgently..plz help me...[plzzzzzzzz  the question...... useing struts or servlet... in eclipse platform...can any one tell me the source code...hpw to write in eclipse platform....plz plz mail me
share your answer to this question
share your answer to this question  i need to know what is the TELERIK CONTROL? what is the map suite? what is dunda chart? Also i have to know what are the websites available which give infor regarding this. Let me know how
pls answer these question
pls answer these question  Write a program that prompts the user to input the length and width of a rectangle. Then calculate and prints the rectangleâ??s area and perimeter.   import java.io.*; class rectangle
Is the answer 35, 35?
Is the answer 35, 35?  int a = 5; int b = 7; int num = 35; while (a < b) { System.out.println(?My age is ? + num); a = a + 1; }   ...; } } } The above program outputs: My age is ? " 35 My age is ? " 35 As you
to know my answer
to know my answer  hi, this is pinki, i can't solve my question "how to change rupee to dollar,pound and viceversa using wrapper class in java." will u help me
provide me the program for that ques.
provide me the program for that ques.  wtite a program in java there is a class readchar.the functionality of this class is to read a string from the console and display the characters of that string on the console.   
plz answer - Java Beginners
plz answer   Write a Binary Search program that searches an array of ordered data. Compose an ordered array of 500 integers that contains the following series of numbers and run the search on it: 1, 2, 3, 5, 8, 13, 21, 34, 55
Plz answer - Java Beginners
------------------------------------------------- plz doreply me....thankz alot  
help me to solve this question...
help me to solve this question...  Given below is a class definition for Book. Type and compile the class, and answer the following questions... price; } } Write a program in a class TestBook that can do the following: Read
help me to solve this problem..
help me to solve this problem..  Given below is a class definition for Book. Type and compile the class, and answer the following questions: class...; } } Write a program in a class TestBook that can do the following: Read
Help me on the given problem of String
Help me on the given problem of String  class Test { string s1...")); System.out.println((s1=="Hel"+lo)); } The above program prints true false I just want to know why the answer of both the println method
i cNT GET ANSWER FOR THIS QUESTION
i cNT GET ANSWER FOR THIS QUESTION  The roots of the quadratic..., the equation has two complex roots. Write a program that prompts the user...- 4ac ââ?°Â¥ 0, the program should output the roots of the quadratic equation
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
help me in these - Java Interview Questions
help me in these  hello every body i have some question if you cam plz answer me it is important to me and these are the questions : 1)Write... in the array . use linear search for this algorithm . test your method. answer me
java program
java program  Problem 1 Write a javaScript program that would input... hours worked:__ Overtime pay:_ Gross pay:__ Guys plz help me 4 this problem thanks I received already the answer last day thanks for the help...Plz answer
help i want it now the answer pleas...
help i want it now the answer pleas...  write a program that will display the exactly output as below: Hints: declare and initialize value of array in double type.Read and write all elements of array.perform the multiply
swing program
tell me answer
help me...
help me...  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog
help me..
help me..  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog mad
help me
help me  MY GLASSFISH SERVER NOT START PROPERLY help me warning shows DPL5404:Specification-Version for the optional package [ GNUJAXP ] in the jarfile [ C:\Program Files\Java\jdk1.7.0_02\jre\lib\ext\gnujaxp.jar
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
help me
the flow of people , cars , airplanes , transactions , and so on . write a program... allocated near to the holes with the largest indexes. your program... help me
Help me
Help me  plz i want code of program to add real numbers and magic numbers in java example this input :- 5+3i-2+3i output:- 3+6i
help me..
help me..  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee... constructor for each class. Draw the UML diagram for the classes. Write a test program
java program for me to see who are on my server
java program for me to see who are on my server  Hello, Im a beginner in java, doing some tutorials and stuff. I wanna write a java program to put on my server where i wanna see if like 3 people are on my server PLUS that i want

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.