Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8). Name five of the fundamental ter ns which encompass object-oriented programming 9). Write a class called NumberOfGoals that represents the total number of goals
8). Name five of the fundamental ter ns which encompass object-oriented programming 9). Write a class called NumberOfGoals that represents the total number of goals scored by a ootball team. The NumberOfGioals class should contain a single integer as data, representing the number of goals scored. Write a constructor to initialize the number of goals to Zero. 10). Write a set of instructions to prompt the user for an int value and input it using the Scanner class into the variable x and prompt the user for a float value and input it using the Scanner class into the variable y 11). Write a class called Shelf that contains instance data that represents the length, breadth, and capacity of the shelf. Also include Boolean variable called occupied as data that represents whether the shelf is occupied or not. Define the Shelf constructor to accept and initialize the height, width, and capacity of the shelf. Each newly created Shelf is vacant ( the constructor should initialize occupied to false. 12) Provide three examples of code using assignment statements where one assignment statement would result in a syntax error, one would result in a logical error, and one would result in a run-time error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started