Create a class named TennisGame that holds data about a single tennis  การแปล - Create a class named TennisGame that holds data about a single tennis  ไทย วิธีการพูด

Create a class named TennisGame tha

Create a class named TennisGame that holds data about a single tennis game. The
class has six fields: the names of the two players, the integer final scores for the
players, and the String values of the final scores. Include a get method for each of
the six fields. Also include a set method that accepts two players’ names, and
another set method that accepts the two integer final score values. The integer final
score for a player is the number of points the player won during the game; this value
should be in the range of 0 through 4. If either of the set method parameters for a
score is not in the range of 0 through 4, assign 0 to both scores and assign “error” to
the String scores. If both players’ score parameters are 4, assign 0 to both scores
and “error” to the String scores. The String score values are set by the method that
sets the integer score values. The String final score for each player contains the
traditional names for points in tennis: love, 15, 30, 40, or game, respectively, for the
values 0 through 4. Create a subclass named DoublesTennisGame that includes two
additional fields for the names of the first two players’ partners. Include get methods
for the names. Override the parent class setNames() method to accept the names of
all four players. Write an application named DemoTennisGames that instantiates
several objects of each of these classes. Demonstrate that all the methods assign
correct values. Save the files as TennisGame.java, DoublesTennisGame.java,
and DemoTennisGames.java
0/5000
จาก: -
เป็น: -
ผลลัพธ์ (ไทย) 1: [สำเนา]
คัดลอก!
Create a class named TennisGame that holds data about a single tennis game. Theclass has six fields: the names of the two players, the integer final scores for theplayers, and the String values of the final scores. Include a get method for each ofthe six fields. Also include a set method that accepts two players’ names, andanother set method that accepts the two integer final score values. The integer finalscore for a player is the number of points the player won during the game; this valueshould be in the range of 0 through 4. If either of the set method parameters for ascore is not in the range of 0 through 4, assign 0 to both scores and assign “error” tothe String scores. If both players’ score parameters are 4, assign 0 to both scoresand “error” to the String scores. The String score values are set by the method thatsets the integer score values. The String final score for each player contains thetraditional names for points in tennis: love, 15, 30, 40, or game, respectively, for thevalues 0 through 4. Create a subclass named DoublesTennisGame that includes twoadditional fields for the names of the first two players’ partners. Include get methodsfor the names. Override the parent class setNames() method to accept the names ofall four players. Write an application named DemoTennisGames that instantiatesseveral objects of each of these classes. Demonstrate that all the methods assigncorrect values. Save the files as TennisGame.java, DoublesTennisGame.java,and DemoTennisGames.java
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 2:[สำเนา]
คัดลอก!
สร้างคลาสชื่อเทนนิสที่มีข้อมูลเกี่ยวกับเกมเทนนิสที่เดียว
ชั้นมีหกสาขา: ชื่อของผู้เล่นทั้งสองคะแนนสุดท้ายจำนวนเต็มสำหรับ
ผู้เล่นและค่า String ของคะแนนสุดท้าย รวมถึงวิธีการที่ได้รับสำหรับแต่ละ
หกสาขา ยังรวมถึงวิธีการตั้งค่าที่ยอมรับชื่อผู้เล่นทั้งสอง 'และ
วิธีการตั้งค่าอื่นที่ยอมรับทั้งสองจำนวนเต็มค่าคะแนนสุดท้าย จำนวนเต็มสุดท้าย
คะแนนสำหรับผู้เล่นคือจำนวนของจุดที่ได้รับรางวัลผู้เล่นระหว่างเกม; ค่านี้
ควรจะอยู่ในช่วง 0 ถึง 4 หากทั้งสองวิธีการตั้งค่าพารามิเตอร์สำหรับ
คะแนนที่ได้จะไม่ได้อยู่ในช่วง 0 ถึง 4 กำหนด 0 คะแนนทั้งสองและกำหนด "ข้อผิดพลาด" เพื่อ
คะแนนสตริง ถ้าพารามิเตอร์คะแนนผู้เล่นทั้งสองมี 4 กำหนด 0 คะแนนทั้งสอง
และ "ข้อผิดพลาด" เพื่อคะแนนสตริง ค่าคะแนน String ถูกกำหนดโดยวิธีการที่
กำหนดค่าคะแนนจำนวนเต็ม String คะแนนสุดท้ายสำหรับผู้เล่นแต่ละคนมี
ชื่อดั้งเดิมสำหรับจุดในเทนนิส: love, 15, 30, 40, หรือเกมตามลำดับสำหรับ
ค่า 0 ถึง 4 สร้าง subclass ชื่อ DoublesTennisGame ที่มีสอง
เขตข้อมูลเพิ่มเติมสำหรับชื่อของ เป็นครั้งแรกที่สองคู่ของผู้เล่น รวมถึงวิธีการได้รับ
ชื่อ แทนที่ setNames ระดับผู้ปกครอง () วิธีการที่จะยอมรับชื่อของ
ทั้งสี่ผู้เล่น เขียนชื่อแอปพลิเค DemoTennisGames ที่ instantiates
วัตถุหลายของแต่ละชั้นเรียนเหล่านี้ แสดงให้เห็นว่าวิธีการทั้งหมดกำหนด
ค่าที่ถูกต้อง บันทึกไฟล์เป็น TennisGame.java, DoublesTennisGame.java,
และ DemoTennisGames.java
การแปล กรุณารอสักครู่..
ผลลัพธ์ (ไทย) 3:[สำเนา]
คัดลอก!
สร้างคลาสชื่อ tennisgame ที่เก็บข้อมูลเกี่ยวกับเกมเทนนิสเดี่ยว
ชั้นมี 6 สาขา : ชื่อของผู้เล่นสองคน , จำนวนเต็มสุดท้ายคะแนนสำหรับ
ผู้เล่นและสตริงค่าของคะแนนสุดท้าย รวมถึงได้รับวิธีการสำหรับแต่ละ
6 สาขา ยังรวมถึงชุดวิธีที่ยอมรับชื่อของผู้เล่นทั้งสองและวิธีการที่ยอมรับ
อีกชุดสองจำนวนเต็มคะแนนสุดท้ายค่าจำนวนเต็มสุดท้าย
คะแนนสำหรับผู้เล่นเป็นจำนวนของจุดที่ผู้เล่นจะในระหว่างเกม นี้ค่า
ควรอยู่ในช่วง 0 ถึง 4 . ถ้าชุดวิธีพารามิเตอร์สำหรับ
คะแนนไม่อยู่ในช่วง 0 ถึง 4 กำหนด 0 ทั้งคะแนน และมอบหมายให้ " ข้อผิดพลาด "

สายคะแนน ถ้าผู้เล่นทั้งคะแนนค่า 4 กำหนด 0 ทั้งคะแนน
" ข้อผิดพลาด " กับสตริงที่คะแนนสตริงคะแนนค่าถูกกำหนดโดยวิธีการที่
ชุดคะแนนเต็มค่า สายสุดท้ายคะแนนผู้เล่นแต่ละประกอบด้วย
ชื่อดั้งเดิมสำหรับจุดในเทนนิส : ความรัก , 15 , 30 , 40 หรือเกมตามลำดับสำหรับค่า
0 ถึง 4 สร้างคลาสชื่อ doublestennisgame ที่ประกอบด้วยสองเขตข้อมูลเพิ่มเติมสำหรับ
ชื่อของคู่ค้าสองผู้เล่นแรก รวมเอาวิธีการ
สำหรับชื่อ ยกเลิก setnames() เรียนผู้ปกครองวิธีการรับชื่อ
ผู้เล่นทั้งหมด 4 คน เขียนโปรแกรมชื่อ demotennisgames ที่ instantiates
หลายวัตถุของแต่ละชั้นเรียนเหล่านี้ แสดงให้เห็นว่าทุกวิธีกำหนด
ค่าถูกต้อง บันทึกไฟล์เป็น tennisgame.java doublestennisgame , Java , และ demotennisgames.java
.
การแปล กรุณารอสักครู่..
 
ภาษาอื่น ๆ
การสนับสนุนเครื่องมือแปลภาษา: กรีก, กันนาดา, กาลิเชียน, คลิงออน, คอร์สิกา, คาซัค, คาตาลัน, คินยารวันดา, คีร์กิซ, คุชราต, จอร์เจีย, จีน, จีนดั้งเดิม, ชวา, ชิเชวา, ซามัว, ซีบัวโน, ซุนดา, ซูลู, ญี่ปุ่น, ดัตช์, ตรวจหาภาษา, ตุรกี, ทมิฬ, ทาจิก, ทาทาร์, นอร์เวย์, บอสเนีย, บัลแกเรีย, บาสก์, ปัญจาป, ฝรั่งเศส, พาชตู, ฟริเชียน, ฟินแลนด์, ฟิลิปปินส์, ภาษาอินโดนีเซี, มองโกเลีย, มัลทีส, มาซีโดเนีย, มาราฐี, มาลากาซี, มาลายาลัม, มาเลย์, ม้ง, ยิดดิช, ยูเครน, รัสเซีย, ละติน, ลักเซมเบิร์ก, ลัตเวีย, ลาว, ลิทัวเนีย, สวาฮิลี, สวีเดน, สิงหล, สินธี, สเปน, สโลวัก, สโลวีเนีย, อังกฤษ, อัมฮาริก, อาร์เซอร์ไบจัน, อาร์เมเนีย, อาหรับ, อิกโบ, อิตาลี, อุยกูร์, อุสเบกิสถาน, อูรดู, ฮังการี, ฮัวซา, ฮาวาย, ฮินดี, ฮีบรู, เกลิกสกอต, เกาหลี, เขมร, เคิร์ด, เช็ก, เซอร์เบียน, เซโซโท, เดนมาร์ก, เตลูกู, เติร์กเมน, เนปาล, เบงกอล, เบลารุส, เปอร์เซีย, เมารี, เมียนมา (พม่า), เยอรมัน, เวลส์, เวียดนาม, เอสเปอแรนโต, เอสโทเนีย, เฮติครีโอล, แอฟริกา, แอลเบเนีย, โคซา, โครเอเชีย, โชนา, โซมาลี, โปรตุเกส, โปแลนด์, โยรูบา, โรมาเนีย, โอเดีย (โอริยา), ไทย, ไอซ์แลนด์, ไอร์แลนด์, การแปลภาษา.

Copyright ©2026 I Love Translation. All reserved.

E-mail: