[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Messages posted by: groucho
Forum Index » Profile for groucho » Messages posted by groucho
Author Message
// below is my first program with more than one method am having trouble debugging it though. I am new to both programming and java. any help is appreciated.




import java.util.Scanner;

public class checkup
{
private int patientNumber;
private int bloodPressSys;
private int bloodPressDia;
private int ldl;
private int hdl;

public static void main (String[] args)
{
int patientNumber;
int bloodPressSys;
int bloodPressDia;
int ldl;
int hdl;
Scanner inputDevice = new Scanner (System.in);

System.out.print("Please enter a patient number: " );
patientNumber = inputDevice.nextInt();
System.out.print("Please enter patient's Systolic Blood Pressure: " );
bloodPressSys = inputDevice.nextInt();
System.out.print("Please enter patient's Diastolic Blood Pressure: " );
bloodPressDia = inputDevice.nextInt();
System.out.print("Please enter patient's LDL Cholesterol: " );
ldl = inputDevice.nextInt();
System.out.print("Please enter patient's HDL Cholesterol: " );
hdl = inputDevice.nextInt();
}
public static double computeRatio (String[] args)
{
double computeRatio;
computeRatio = (ldl % hdl);
return computeRatio;
}

public static void explainRatio ()
{
System.out.println (" HDL is known as Good Cholesterol. Any ratio of 3.5 or lower is considered optimum. ");
}


public static double patientInfo (String[] args)
{
System.out.println("Patient number is " + patientNumber +
" Systolic Blood Pressure is " + bloodPressSys +
" Diastolic Blood Pressure is " + bloodPressDia +
" Cholesterol number is " + computeRatio + explainRatio);
}
}

download jedit to create java text files...
go to utilities and launch terminal

cd to where your java files are stored ex: cd documents/javafiles

then do as usual javac file.java
 
Forum Index » Profile for groucho » Messages posted by groucho
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle