Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Beg your java code , thank you very much. the diving.txt include: James Wong New Zealand 5.5 6.0 5.5 5.0 5.5 6.5 5.0 2.8 6.5

Beg your java code , thank you very much.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

the diving.txt include:

James Wong New Zealand 5.5 6.0 5.5 5.0 5.5 6.5 5.0 2.8 6.5 7.0 5.5 7.0 5.5 6.5 6.0 2.4 4.5 4.0 4.5 4.0 4.5 4.5 4.0 3.1 Xiao Wong China 7.5 8.0 8.5 8.0 7.5 8.5 8.0 2.6 6.5 7.0 5.5 7.0 5.5 6.5 6.0 3.0 8.5 8.0 8.0 8.0 9.0 9.0 8.5 2.8 Ken Momata Japan 6.5 6.5 6.5 6.0 7.0 6.5 6.0 2.6 5.5 4.0 5.5 4.0 5.5 4.5 5.0 2.8 6.0 5.5 5.5 6.0 6.5 6.0 6.0 2.5 Anton Andrew United States 7.5 7.0 6.5 8.0 8.0 7.5 7.0 2.4 5.5 6.0 6.5 5.0 5.5 5.5 6.0 3.0 7.0 7.0 7.5 7.5 7.0 6.5 7.5 2.8 Oliver Martin Germany 8.0 8.5 8.5 8.0 7.5 8.5 8.0 2.4 7.0 7.5 7.0 7.5 7.5 7.5 6.5 2.8 4.5 5.0 5.0 5.5 5.5 5.5 4.5 3.1

. 2. Pertandingan terjun adalah acara yang terkenal dalam Sukan Olimpik. Penganjur telah melantik anda untuk menulis aturcara Java yang menentukan pemenang untuk pertandingan tersebut. Reka satu kelas bernama Diving yang terdiri daripada ahli berikut: Satu medan untuk nama peserta. Satu medan untuk negara. Satu medan untuk tujuh markah hakim dalam 3 percubaan. Satu medan untuk penilaian kesukaran dalam 3 percubaan. Pembina yang mengandungi empat argumen medan di atas. Kaedah pengakses untuk nama peserta dan negara. Kaedah yang mengembalikan markah akhir. Markah dikira dengan mengalih keluar dua markah teratas dan dua markah terbawah; baki tiga markah ditambah bersama dan didarab dengan penilaian kesukaran dalam setiap percubaan. Markah akhir ialah jumlah markah keseluruhan dalam 3 percubaan. Kaedah toString yang memulangkan profil peserta, markah hakim, penilaian kesukaran dan markah akhir. 1 Diving competition is a famous event in the Olympics. The organizer has appointed you to write a Java program that determine the winner of the event. Design a class named Diving that consists of the following members: A field for the participant's name. A field for the country. A field for the seven judges scores in 3 attempts. A field for the difficulty rating in 3 attempts. A constructor that contains the four arguments of the above fields. An accessor method for participant name and an accessor method for country. A method that returns the final score. The score is calculated by removing the top two scores and the bottom two scores, the remaining three scores are added together and multiplied by the difficulty rating in each attempt. The final score is the sum of the total score in 3 attempts. A to String method that return participant profile, judges scores, difficulty rating and final score. 1 Tulis kelas penguji yang mempunyai berikut: Baca profil peserta, markah hakim dan penilaian kesukaran daripada fail teks bernama diving.txt dan tetapkan nilai kepada objek tatasusunan kelas Diving. (Anda mesti menentukan bilangan rekod dalam fail teks menggunakan program anda) Kandungan separa fail teks adalah seperti di bawah, nilai terakhir untuk setiap percubaan ialah penilaian kesukaran. James Wong New Zealand 5.5 6.0 5.5 5.0 5.5 6.5 5.0 2.8 6.5 7.0 5.5 7.0 5.5 6.5 6.0 2.4 4.5 4.0 4.5 4.0 4.5 4.5 4.0 3.1 Xiao Wong China 7.5 8.0 8.5 8.0 7.5 8.5 8.0 2.6 6.5 7.0 5.5 7.0 5.5 6.5 6.0 3.0 8.5 8.0 8.0 8.0 9.0 9.0 8.5 2.8 Paparkan semua profil peserta, markah hakim, penilaian kesukaran dan markah akhir. Kaedah yang mengandungi satu argumen berjenis objek tatasusunan kelas Diving. Kaedah tersebut memaparkan pemenang untuk emas, perak dan gangsa. Peserta yang mendapat markah akhir tertinggi akan menerima emas, manakala markah kedua dan ketiga tertinggi akan menerima perak dan gangsa. Write a tester class that has the following: Read the participant profile, judges scores and difficulty rating from a text file named diving.txt and assigned the value to the array objects of Diving class. (You must determine the number of records in the text file using your program) The partial contents of the text file are as below, the last value for each attempt is the difficulty rating. James Wong New Zealand 5.5 6.0 5.5 5.0 5.5 6.5 5.0 2.8 6.5 7.0 5.5 7.0 5.5 6.5 6.0 2.4 4.5 4.0 4.5 4.0 4.5 4.5 4.0 3.1 Xiao Wong China 7.5 8.0 8.5 8.0 7.5 8.5 8.0 2.6 6.5 7.0 5.5 7.0 5.5 6.5 6.0 3.0 8.5 8.0 8.0 8.0 9.0 9.0 8.5 2.8 Display all the diver profiles, judges scores, difficulty rating and final score. A method that contains one argument array objects of Diving class. The method displays the winner for gold, silver and bronze. The participant with the highest final score will receive gold, while the second and third highest score will receive silver and bronze. (Namakan fail Diving.java sebagai [matricNumberDiving.java]; contoh: 17171717Diving.java, Main.java sebagai [matricNumberQ2.java]; contoh: 17171717Q2.java) (Rename the Diving.java file as (matricNumberDiving.java]; example: 17171717Diving.java, Main.java file as [matricNumberQ2.java); example: 17171717Q2.java) Contoh output: Sample output: Diver : James Wong (New Zealand) Judges Scores : 5.5 6.0 5.5 5.0 5.5 6.5 5.0 Difficulty Rating : 2.8 Judges Scores : 6.5 7.0 5.5 7.0 5.5 6.5 6.0 Difficulty Rating : 2.4 Judges Scores : 4.5 4.0 4.5 4.0 4.5 4.5 4.0 Difficulty Rating : 3.1 Final Score : 132.1 . Diver : Xiao Wong (China) Judges Scores : 7.5 8.0 8.5 8.0 7.5 8.5 8.0 Difficulty Rating : 2.6 Judges Scores : 6.5 7.0 5.5 7.0 5.5 6.5 6.0 Difficulty Rating : 3.0 Judges Scores : 8.5 8.0 8.0 8.0 9.0 9.0 8.5 Difficulty Rating : 2.8 Final Score : 189.4 Gold : Participant Name??? (Country???) Silver : Participant Name??? (Country???) Bronze : Participant Name??? (Country???)

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

Step: 3

blur-text-image

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 And Expert Systems Applications Dexa 2021 Workshops Biokdd Iwcfs Mlkgraphs Al Cares Protime Alsys 2021 Virtual Event September 27 30 2021 Proceedings

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Atif Mashkoor ,Johannes Sametinger ,Anna Fensel ,Jorge Martinez-Gil ,Lukas Fischer

1st Edition

3030871002, 978-3030871000

More Books

Students also viewed these Databases questions