String nam1; intide1; intbowl1; intbowl2; intbowl3; out.print(\"Enter bowler\'s
ID: 3615134 • Letter: S
Question
String nam1;intide1;
intbowl1;
intbowl2;
intbowl3;
out.print("Enter bowler's number:");
ide1=keyboard.nextInt();
out.printf("Please enter bowler %d's name:",ide1);
nam1=keyboard.next();
out.printf("Enter %s's three scores:",nam1);
right here i want to be able to store all three scores but idont know what command to type in, in order for all threescores to be stored and displayed....could you helpme?? i wuz thinking about putting..... bowl1,bowl2,bowl3=keyboar.nextInt(); but i kept getting errors when i compiled the program. String nam1;
intide1;
intbowl1;
intbowl2;
intbowl3;
out.print("Enter bowler's number:");
ide1=keyboard.nextInt();
out.printf("Please enter bowler %d's name:",ide1);
nam1=keyboard.next();
out.printf("Enter %s's three scores:",nam1);
right here i want to be able to store all three scores but idont know what command to type in, in order for all threescores to be stored and displayed....could you helpme?? i wuz thinking about putting..... bowl1,bowl2,bowl3=keyboar.nextInt(); but i kept getting errors when i compiled the program. i wuz thinking about putting..... bowl1,bowl2,bowl3=keyboar.nextInt(); but i kept getting errors when i compiled the program.
Explanation / Answer
please rate - thanks import java.util.*; public class untitled { public static void main (String [] args) {String nam1; intide1; intbowl1; intbowl2; intbowl3; Scanner keyboard=new Scanner(System.in); System.out.print("Enter bowler's number:"); ide1=keyboard.nextInt(); System.out.printf("Please enter bowler %d's name:",ide1); nam1=keyboard.next(); System.out.printf("Enter %s's three scores:",nam1); System.out.print("Enter score 1: "); bowl1=keyboard.nextInt(); System.out.print("Enter score 2: "); bowl2=keyboard.nextInt(); System.out.print("Enter score 3: "); bowl3=keyboard.nextInt(); System.out.printf("%s, bowler %d, bowled %d %d and %d",nam1,ide1,bowl1,bowl2,bowl3); } }