Hi, for a homework assignment I need to create a program that keeps track of the bowling scores of a number of players. I have the user enter the number of players, and then an array of objects is created with enough indexes for each player. Then I have the user enter a name for each player in a for loop, where I want to create an object for each player name. From what I've seen on other websites what I'm doing should work...but it's not! any help would be greatly appreciated, thanks.
package chap7ex7; import java.util.Scanner; public class Chap7ex7 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("-- Bowling Scorekeeper --\n"); System.out.println("How many players are playing?"); int players = input.nextInt(); bowlingclass names[] = new bowlingclass[players]; System.out.println("Enter the name of each player."); String name; for (int i = 0; i < players; i++){ name = input.nextLine(); //enter player name names[i] = new bowlingclass(name); //I get an error: constructor bowling calss in class bowlingclass cannot be applied to given types //required: no arguments found:String reason: actual and formal arugments lists differ in length } } }
in my class I have: