ok, so i have a problem to do in java that i just can't seem to figure out. here is the problem: Write a Java program that prompts the user for how many individuals they will be entering.
Then program will then prompts for each individuals name and account balance. The output of
the program will be the person with the highest account balance (name and balance) and the
lowest account balance (name and balance). All output should be to 2 decimal places.
i dont have a problem with formatting the output or anything i just cant seem to figure this out.
Here's my code:
import java.util.*;
public class Problem2
{
public static void main(String args[])
{
double dblCount = 0;
double dblBalance = 0;
Scanner sc = new Scanner(System.in);
System.out.print("How many Balances will you be entering?: ");
double dblNumber = sc.nextDouble();
do
{
dblCount = dblCount + 1;
System.out.print("Enter a Name: ");
String strName = sc.next();
System.out.print("Enter a Balance: ");
double dblInput = sc.nextDouble();
if(dblInput > dblInput)
{
dblBalance = dblInput;
}
}
while(dblNumber >= dblCount);
System.out.println(dblBalance);
}
}
i'm stuck. If sombody could just point me in the right direction that would be great.
Thanks