Share on Google+Share on Google+

1 Answer(s)      7 years ago
Posted in : Java Beginners


View Answers

October 13, 2009 at 3:06 PM

Hi Friend,

Try the following code:

import java.util.*;

public class Student{
int matricNo;
double quizMarks;
double assignMarks;
double test1Marks;
double test2Marks;
double finalMarks;
double totalMarks;
String grade;
public void setMatricNo(int matricNo){
public int getMatricNo(){
return matricNo;
public void setQuizMarks(double quizMarks){
public double getQuizMarks(){
return quizMarks;
public void setAssignMarks(double assignMarks){
public double getAssignMarks(){
return assignMarks;
public void setTest1Marks(double test1Marks){
public double getTest1Marks(){
return test1Marks;
public void setTest2Marks(double test2Marks){
public double getTest2Marks(){
return test2Marks;
public void setFinalMarks(double finalMarks){
public double getFinalMarks(){
return finalMarks;
public void setTotalMarks(double totalMarks){
public double getTotalMarks(){
return totalMarks;
public void setGrade(String grade){
public String getGrade(){
return grade;
public static void main(String[]args){
Scanner input=new Scanner(;
Student data[]=new Student[2];
for (int i=0; i<data.length; i++) {
System.out.println("Enter Matric No");
int no=input.nextInt();
System.out.println("Enter quiz marks");
double q=input.nextDouble();
System.out.println("Enter Assignment marks");
double a=input.nextDouble();
System.out.println("Enter test1 marks");
double t1=input.nextDouble();
System.out.println("Enter test2 marks");
double t2=input.nextDouble();
System.out.println("Enter final marks");
double f=input.nextDouble();
double tm=.15*q+.15*a+.15*t1+.15*t2+.40*f;
System.out.println("Total Marks="+tm);
data[i] = new Student();

for(int i=0;i<2;i++){
Student show = data[i];
int no1=show.getMatricNo();
double q1=show.getQuizMarks();
double a1=show.getAssignMarks();
double t11=show.getTest1Marks();
double t21=show.getTest2Marks();
double f1=show.getFinalMarks();
double tm1=show.getTotalMarks();
String g = show.getGrade();
System.out.println(no1 + " " + q1 + " " + a1+" "+t11+" "+t21+" "+f1+" "+tm1+" "+g);

Related Tutorials/Questions & Answers:
Student database
Student database  Create a class Student with Name, Gender, and Date of Birth and Input Student and print as ?Dear Mr/Mrs Name, your Age is 99 Years?. Mr/Mrs - only one should be displayed based on their age and Gender
student details
student details  hi sir/madam i have a doubt in PHP how to insert student details using mysql with php..   Have a look at the following link: PHP Mysql insert
student details
student details  create an application for details of 1st to 5th standard students by using loops and scanner
student info
student info  code of insert,delete,update,view,search of student information using jsp and servelts   Hi Friend, Please visit the following links: http
student database
student database  student records such as fees-school fees, dob,age,if any due.the record stored should be like this record,name,age,dob,fee list or any dues of the student record1 isha 15 20jan record2 spandana 14 4feb record3
Student average
Student average  you are an academic requirement... that reads student's number of subject taken, the final grade of each subject... should display the average grade of the student and would display the message
Student Marks
Student Marks  Hi everyone I have to do this java assignment... programming grades of 8 IT students. Randomly create student numbers for each... in an array. Addresses of Students and store them in array. Previous Grade for student
Student Marks
Student Marks  Create a simple application which can calculate 5 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
student information system
student information system  can you show me example of "student information system" pseudo code and flow chart with "student name, student id, student residential hall, student course, student phone numbers
html code for student information?
html code for student information?  html code for student information
student admission system project
student admission system project  College Student Admission System... Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based,its urgent sir
school student attendence report
school student attendence report  Hi i want school student attendence genaration source code please urgent help me
student weekly attandence genaration
student weekly attandence genaration  Hievery body iam doing student project in that i want student weekly ,yearly attendence generation report this project doing on struts frame front as java back end as oracle 10 g
STUDENT MANAGEMENT SYSTEM  can any one help me with the coding if this using awt please!!!!!!! STUDENT MANAGEMENT SYSTEM Table details Student...:insert/update/delete/search student:insert/update/delete/search :result entry
project for Student Admission System
project for Student Admission System  I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way
Student Management System
Student Management System  Hi , Friend can i get the solution for connecting login page of JFrames to JDBC
college student admission
college student admission  Front End -JAVA Back End - MS Access Hello Sir, I want College Student Admission Project in Java with Source code, that includes Following Forms 1) Student Admission based on Enterance Exam Marks
student attendence report
student attendence report  Hi every body iam doing a school project iam using backend as oracle 10g front end as java . in my project generate student attendence daywise ,monthly ,halfyearly and yearly how i generate plz
Student - Java Beginners
Student  Create a class named Student which has data fields of student metric number, mark for the quizzes (15% from the total mark), lab assignments..., Try the following code: import java.util.*; public class Student{ int
student registration example
student registration example  1.reg.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http
genarating student weekly progress report
genarating student weekly progress report  Hi every one iam using struts frame work backend as oracle 10g . i want code for how to genarate student weekly and monthly marks . thanks in advance
Tutorial college Student Admission System
Tutorial college Student Admission System  I want PHP Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way..... please send me synopsis
creating an applet for student management system
creating an applet for student management system  Write an applet/awt... a student management system having the following characteristics: The interface... it to act), and reasonably realistic. It must accept the student id,name,age,address
sorting student record - Java Beginners
sorting student record  Program in java for inserting, recording, deleting, editing and searching student details   can u explain about recording ? u want to store value in database or in file or opertinng run time
how to develop student details using springs
how to develop student details using springs  how to develop student details using springs
Write a program to get student details and store in a database
Write a program to get student details and store in a database  Write a program to get student details and store in a database
Student Information System in Java - Java Beginners
Student Information System in Java  Hello Sir, I want Mini Java Project for Student Admission System.  Hi Friend, Can you provide us details regarding your project like student admission form, faculty information
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null