Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Classes * Classwork for AP CS X replil - Unit 5 Reviev X C Java Programming l x M Your question was a x C

image text in transcribed

Classes * Classwork for AP CS X replil - Unit 5 Reviev X C Java Programming l x M Your question was a x C Classes X Classwork X + 9 X Apps repl.it/student/submissions/10570032 FTC Coach & Team... Photoshop Portable... a Amazon.com Shop. Download your NA... replit Unit 5 Review: Player Class my repls student notifications 88 talk tenornye (0) back to classroom run Due: - submit Instructions from your teacher Main.java Player.javo: Ctrl + Enter 1. class Main { public static void main(String[] args) { This exercise is worth 10 points. To earn all 10 points, you must add comments, your code must work, and all requirements must be met. Player numi = new Player(3, 2); System.out.println(num1.getScore()); 1. The Player class will contain two int attributes and a constructor. The class will also contain a method getScore that can be accessed from outside the class. Fill in the /* missing */ code section. The attribute names are score and id. Both these fields will also be passed to the constructor. The getScore method will return the score and has 10 added points to it. 2. Create a tester class, Main, to run the java program. It will also create two instances of the class Player and will pass it a score and id. It will also print the player id and player score after calling the getScore method. exit status 1 Riddle.java:12: error: incompatible types: unexpected return value return riddle; Riddle.java:15: error: incompatible types: unexpected return value return answere; 2 errors Play-Terms : Type here to search o g e op ^ . 4 129/2020

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Rob, Carlos Coronel

6th International Edition

061921323X, 978-0619213237

More Books

Students also viewed these Databases questions

Question

7.59 Explain the difference between an x chart and a p chart.

Answered: 1 week ago

Question

1. Identify and control your anxieties

Answered: 1 week ago