I have to create a small program using only if - else and loops, where a user enters how many numbers they are going to enter, enters all the numbers, and the program outputs the smallest number divided by the biggest. This is all in Java. This is what I have so far, I'm pretty new to this!
double amtNum, doubleCnt, num; doubleCnt = 0;
String dataIn;
System.out.print("How many numbers would you like to enter: ");
dataIn = input.readLine();
amtNum = Integer.parseInt(dataIn);
while (doubleCnt < amtNum){
doubleCnt +=1;
System.out.print("First Number: ");
dataIn = input.readLine();
num = Integer.parseInt(dataIn);
Aucun commentaire:
Enregistrer un commentaire