Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML

Fresher Job


 

Search Host

Monthly Fee($)
Disk Space (MB)
Register With us for Newsletter!
Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Have tutorials?
Add your tutorial to our Java Resource and get tons of hits.

We offer free hosting for your tutorials. and exposure for thousands of readers. drop a mail
roseindia_net@yahoo.com
 
   

Tutorials

Java Server Pages

JAXB

Java Beans

JDBC

MySQL

Java Servlets

Struts

Bioinformatics

Java Code Examples

Interview Questions

 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Web Promotion

Web Submission

Submit Sites

Manual Submission?

Web Promotion Guide

Hosting Companies

Web Hosting Guide

Web Hosting

Linux

Beginner Guide to Linux Server

Frameworks

Persistence Framework

Web Frameworks

Free EAI Tools

Web Servers

Aspect Oriented Programming

Free Proxy Servers

Softwares

Adware & Spyware Remover

Open Source Softwares

OOP
Expert:leshomo
i have problem with OOP hope u'll help me write a program that allows the user to enter student' names followed by their test scores and outputs the following information (assume that the maximum number of students in the class is 50);
a Class average
b Names of all the students whose test scores are below the class average, with an appropriate message
c highest test score and names of all the students having the highes score

Answers
answer
answer
hi friend,


import java.io.*;
import java.io.IOException;
import java.util.*;

public class StudentInfor{

//public static void main(String args[]) throws IOException{

public static void main(String[] args) throws IOException {

BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Student Information example");
Scanner input = new Scanner(System.in);
//... These variables hold the max and min incomes.
double maxnum = Double.MIN_VALUE;
double minnum = Double.MAX_VALUE;
int count = 0;
double totalIncome = 0;
//... Loop until negative number is entered.
System.out.println("Enter student number.");
while (input.hasNextDouble()) {
//... Get the next value.
double dou = input.nextDouble();
//... Compare this value to max and min. Replace if needed.
if (dou > maxnum) {
maxnum = dou;
}
if (dou < minnum) {
minnum = dou;
}
//... Keep track of these values for average calculation.
count++;
totalIncome += dou;
}
if (count > 0) {

double average = totalIncome/ count;

System.out.println("Number of values = " + count);
System.out.println("Maximum = " + maxnum);
System.out.println("Minimum = " + minnum);
System.out.println("Average = " + average);
} else {
System.out.println("Error: You entered no data!");
}
}
}

----------------------------

read for more information,

http://www.roseindia.net/java/master-java/java-object-oriented-language.shtml


More Questions
Post Answers
 
Ask Question Facing Programming Problem?
Useful Links
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.