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

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 Tutorials/Questions & Answers:
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
Advertisements
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
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
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
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
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.   
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
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
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
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
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
hi,i'am new to Jsp.Can some one please let me know an answer for this question?
hi,i'am new to Jsp.Can some one please let me know an answer for this question?  how do we upload an xml file and validate them against WIPO DTD
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
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
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
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
please help me in coding this given program
please help me in coding this given program  consider the below... are the prime numbers in ascending order write a program to find the nth term in this series. (i m unable to code this program..please provide solution
compile this program and let me know the resolution
compile this program and let me know the resolution  class Maxof2{ public static void main(String args[]){ //taking value as command line...+" is greater than "+i); } } please compile and let me know the resolution  
please help me for this program - Java Beginners
please help me for this program   Write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two values. Enter Start: 10 Enter End: 14 10
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line...;Hi Friend, Output of this program is: a=2 b=0 c=0 mul=27 volume=18
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
plese tell me the control flow of this program
plese tell me the control flow of this program  public class starForTest { public static void main(String [] args) { for (int... k....? plese tell me the control flow
please help me in a java program !! - Java Beginners
please help me in a java program !!  the porgram should use...://en.wikipedia.org/wiki/Kosaraju_algorithm) there are 4 classes in my program : Vertex... and run the program" i still need to modify the method kosaraju in the class Graph
please tell me the flow of execution of this program
please tell me the flow of execution of this program  class Test{ int x; Test(int x){ this.x=x; } static void access(){ System.out.println("x= "+x); }} class Static{ public static void main(String ar[]){ Test obj=new Test(55
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three buttons: ?Fruit?, ?Bird? and ?Animal? Step 2: On clicking ?Fruit? button
please eslain me the flow of execution of this program
please eslain me the flow of execution of this program  class Producer extends Thread { StringBuffer sb; boolean dataprodover = false; Producer(){ sb = new StringBuffer(); } public void run(){ for(int i=1;i<=10;i++){ try
it is a linux program is there anyone who can help me out with it?
it is a linux program is there anyone who can help me out with it?  Write a Bash script that prompts the user for a user-ID and displays the corresponding userââ?¬â?¢s login name, ownerââ?¬â?¢s name, and his/her home directory
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
plz help me out with this problem...please write the program for me.thanxxxxx
plz help me out with this problem...please write the program for me.thanxxxxx  Write a program that will print out a hydro bill. The bill will be formatted as the example on the next page. The following information
Getting Exception on UseDefinedException sample program - Please help me how to resolve
Getting Exception on UseDefinedException sample program - Please help me how to resolve  class UseDefinedException extends Exception{ String msg = ""; int marks; public UseDefinedException() ){ } public
Pleae help me to give logic and code for this program - Java Beginners
Pleae help me to give logic and code for this program  Write a function that given the string ?original? create a new string ?dramatic? that has two consecutive copies of each letter from the original string. For example
how can i write this program ?please suggest me
how can i write this program ?please suggest me  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
very urgent : Iam unable to code this program plz help me - RMI
very urgent : Iam unable to code this program plz help me  Write a Multi-user chat server and client.  Hi friend, Chat server is a standlone application that is made up the combination of two-application, server
session realtime usage program simple jsp program or servlet ,which understands me importance of session
session realtime usage program simple jsp program or servlet ,which understands me importance of session  I knew importance of session theoritically... related program whether it may be loginpage or anything must simple understanding
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
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

Ads