
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
hello! can you help me debug my
line 126: the method newFantasyFootball is undefined for the type FantasyFootball
line 127: the method enterInData is undefined for the type FantasyFootball
![1.
package fantasyFootball;
2
import java.util.Scanner;
4
public class FantasyFootball
{
private int numberofTeams; //same as teamAverage. length
private int numberofWeeks; //same as weekAverage.lenght
private int[[] scores; //number of teams rows & number of weeks columns
private double[] weekAverage; // contains an entry for each week
private double[] teamAverage; // contains an entry for each team
private String [] teamName; // contains an entry for each team
6.
8.
9.
10
11
12
13
14-
public void enterInDate (
15
16
Scanner keyboard = new Scanner(System.in);
System.out.println ("Enter number of team:");
numberofTeams = keyboard.nextInt();
17
18
19
20
System.out.println ("Enter number of weeks:");
numberofWeeks = keyboard.nextInt();
21
22
//String teamName []=new String [number0fTeams];
//int scores[][]=new int [number0fTeams] [number0fWeeks];
23
24
25
//allocate array memory for teamName to store the team names
//allocate array memory for scores (2-d array) to store a
//score for each team for each week
26
27
28
29
for (int team = 0; team < numberofTeams; team++)
{
System.out.println("Enter team name");
30
31
32
33
34
//Read in team name and store it in TeamName
35
String name=keyboard.nextLine ();
teamName [team]=name;
for (int week = 0; week < number0fWeeks; week++)
36
37
38
39
System.out.println("Enter score for team "+teamName [team]);
System.out.println("on week number "+(week+1));
//read in a score and store it in the proper spot in the scores array
int score=keyboard.nextInt();
scores[team] [week]=score;
40
42
43
44
45
46
47
48 -
public void fillTeamAverage()
49
//allocate memory for the teamAverage
//each entry in this array will contain the
//average weekly score for a given team
//double teamAverage[]=new double [number0fTeams]
for (int team=0; team < number0fTeams; team++)
50
51
52
53
54
55
int sum=0;
double average=0.0;
for (int week =0; week < numberofWeeks; week++)
56
57
58
59
sum=sum+scores [team] [week];
60
61
average=sum/number0fWeeks;
teamAverage [team]=average;
62
63
64
65
66 -
67
68
public void fillweekAverage()
//Allocate memory for the weekAverage instance variable
//each entry in this array will contain the average of
//all teams for a given week
69
70
71
72
//double weekAverage []=new double [number0fTeams];
73
74
for (int week = 0; week < numberofWeeks; week++)
75
int sum = 0;
double average = 0.0;
for (int team = 0; team < numberofTeams; team++)
76
77
78
79
80
sum = sum + scores [team] [week];
81
82
83
84
average=sum/number0fTeams;
weekAverage [number0fWeeks]=average;
85
86 -
87
public void display()
//this method will print out the display that was shown above
//at this point all of the information can be found in the
//private instance variables of the FantasyFootball class
System.out.print ("Team Name");
88
89
90
91](https://content.bartleby.com/qna-images/question/105a6b10-1479-49f6-854d-b98a0aa319bf/a0b3a848-fa69-42f8-91b9-887bfbebc528/0h4i0u.png)
Transcribed Image Text:1.
package fantasyFootball;
2
import java.util.Scanner;
4
public class FantasyFootball
{
private int numberofTeams; //same as teamAverage. length
private int numberofWeeks; //same as weekAverage.lenght
private int[[] scores; //number of teams rows & number of weeks columns
private double[] weekAverage; // contains an entry for each week
private double[] teamAverage; // contains an entry for each team
private String [] teamName; // contains an entry for each team
6.
8.
9.
10
11
12
13
14-
public void enterInDate (
15
16
Scanner keyboard = new Scanner(System.in);
System.out.println ("Enter number of team:");
numberofTeams = keyboard.nextInt();
17
18
19
20
System.out.println ("Enter number of weeks:");
numberofWeeks = keyboard.nextInt();
21
22
//String teamName []=new String [number0fTeams];
//int scores[][]=new int [number0fTeams] [number0fWeeks];
23
24
25
//allocate array memory for teamName to store the team names
//allocate array memory for scores (2-d array) to store a
//score for each team for each week
26
27
28
29
for (int team = 0; team < numberofTeams; team++)
{
System.out.println("Enter team name");
30
31
32
33
34
//Read in team name and store it in TeamName
35
String name=keyboard.nextLine ();
teamName [team]=name;
for (int week = 0; week < number0fWeeks; week++)
36
37
38
39
System.out.println("Enter score for team "+teamName [team]);
System.out.println("on week number "+(week+1));
//read in a score and store it in the proper spot in the scores array
int score=keyboard.nextInt();
scores[team] [week]=score;
40
42
43
44
45
46
47
48 -
public void fillTeamAverage()
49
//allocate memory for the teamAverage
//each entry in this array will contain the
//average weekly score for a given team
//double teamAverage[]=new double [number0fTeams]
for (int team=0; team < number0fTeams; team++)
50
51
52
53
54
55
int sum=0;
double average=0.0;
for (int week =0; week < numberofWeeks; week++)
56
57
58
59
sum=sum+scores [team] [week];
60
61
average=sum/number0fWeeks;
teamAverage [team]=average;
62
63
64
65
66 -
67
68
public void fillweekAverage()
//Allocate memory for the weekAverage instance variable
//each entry in this array will contain the average of
//all teams for a given week
69
70
71
72
//double weekAverage []=new double [number0fTeams];
73
74
for (int week = 0; week < numberofWeeks; week++)
75
int sum = 0;
double average = 0.0;
for (int team = 0; team < numberofTeams; team++)
76
77
78
79
80
sum = sum + scores [team] [week];
81
82
83
84
average=sum/number0fTeams;
weekAverage [number0fWeeks]=average;
85
86 -
87
public void display()
//this method will print out the display that was shown above
//at this point all of the information can be found in the
//private instance variables of the FantasyFootball class
System.out.print ("Team Name");
88
89
90
91
![System.out.print('\t');
int i=0, j=0;
while(i<numberofWeeks)
92
93
94
95
System.out.print("Team"+(i+1));
System.out.print('\t');
i++;
System.out.println();
i=0;
while(i<number0fTeams)
{
System.out.print (teamName [i]);
System.out.print ('\t');
j=0;
while(j<number0fWeeks)
{
System.out.print (scores [i]);
System.out.println();
i+t;
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
j=0;
System.out.print ("Weekly Avg");;
System.out.print ('\t');;
while(j<number0fWeeks)
112
113
114
115
116
117
118
System.out.print((int)weekAverage [j]);
System.out.print('\t');;
j++;
119
120
121
122
123
124
125
126
127
128
public static void maind (String[] args)
FantasyFootball f= newFantasyFootball();
f.enterInData();
f.fillTeamAverage ();
f.fillweekAverage ();
129
130
131
f.display();
132
133](https://content.bartleby.com/qna-images/question/105a6b10-1479-49f6-854d-b98a0aa319bf/a0b3a848-fa69-42f8-91b9-887bfbebc528/dm5uf5m.png)
Transcribed Image Text:System.out.print('\t');
int i=0, j=0;
while(i<numberofWeeks)
92
93
94
95
System.out.print("Team"+(i+1));
System.out.print('\t');
i++;
System.out.println();
i=0;
while(i<number0fTeams)
{
System.out.print (teamName [i]);
System.out.print ('\t');
j=0;
while(j<number0fWeeks)
{
System.out.print (scores [i]);
System.out.println();
i+t;
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
j=0;
System.out.print ("Weekly Avg");;
System.out.print ('\t');;
while(j<number0fWeeks)
112
113
114
115
116
117
118
System.out.print((int)weekAverage [j]);
System.out.print('\t');;
j++;
119
120
121
122
123
124
125
126
127
128
public static void maind (String[] args)
FantasyFootball f= newFantasyFootball();
f.enterInData();
f.fillTeamAverage ();
f.fillweekAverage ();
129
130
131
f.display();
132
133
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Python Programming: Write a program using unittest.TestCase methods to confirm that the addition and subtraction of date and timedelta objects produce correct results. Important notes: Use the unittest module to create a TestCase to test that the addition and subtraction of date and timedelta objects produce correct results... For example I could create a TestCase with a function that tests the addition of date and timedelta objects; a function that tests the subtraction of date and timedelta and then call unittest's main method at the end. When you run this program, it should tell us whether the text was successful or not. See attached image for what the output should look like.arrow_forwardbasic java please Write a method called findTip that finds the value of a meal as a double after adding the tip to the cost. Then return this value to the calling function. For example findTip(120.10, 5) would 126.105 because that is a 5% tip. While findTip(48.0, 15) would return 55.2 because that is a 15% tip. Note that the bill is a double while the tip is an int. Don’t worry about rounding to two decimal places, just return the full value as a double.arrow_forwardHelp with codearrow_forward
- Instructor note: This lab is part of the assignment for this chapter. This lab uses two Java files, LabProgram.java and SimpleCar.java. The SimpleCar class has been developed and provided to you already. You don't need to change anything in that class. Your job is to use the SimpleCar class to complete the specified tasks in the main() method of LabProgram.java Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar object that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status The SimpleCar class is found in the file SimpleCar.java. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 milesarrow_forwardUsing the Python language answer the following questions below. Please tell me what program you use if it is IDLE or Atom or a python website please provide the website you use.arrow_forwardHelp me debug this exercise using Javaarrow_forward
- Understanding ifStatements Summary In this lab, you complete a prewritten Java program for a carpenter who creates personalized house signs. The program is supposed to compute the price of any sign a customer orders, based on the following facts: The charge for all signs is a minimum of $35.00. The first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. If the sign is made of oak, add $20.00. No charge is added for pine. Black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. Instructions 1. Ensure the file named HouseSign.java is open. 2. You need to declare variables for the following, and initialize them where specified: A variable for the cost of the sign initialized to 0.00 (charge). A variable for the number of characters initialized to 8 (numChars). A variable for the color of the characters initialized to "gold" (color). A variable for the…arrow_forwardTask instruction In cell D13 creat a formula using the MAX function to calculate the maximum value in the rangeD4:D11arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education