Find Jobs
Hire Freelancers

Java Fish Tank

$10-30 USD

กำลังดำเนินการ
โพสต์ มากกว่า 6 ปีที่ผ่านมา

$10-30 USD

ชำระเงินเมื่อส่งงาน
In this assignment, you are going to develop simulation of fish in a fish tank. The goal is to practice Object Oriented Concepts and Comparable, MouseListener and MouseMotionListener Interfaces. The fish tank has 2 modes of status, fish manipulation and simulation. In the fish manipulation status, the user can: add new fish to the tank, drag a fish to a different slot, To implement these manipulation functionalities, you need to implement three functions: MouseClicked, MouseDragged and MouseReleased. MouseClicked: Verify that the application is in manipulation mode. Construct a new fish object at the clicked point with a random colour If the selected slot is not occupied by another fish, add the new fish to the tank Paint MouseDragged: Verify that the application is in manipulation mode. Set mouseDragged to true Find out which fish is selected from the tank MouseReleased: Verify that mouseDragged is true Verify that the selected slot is empty Update the position of the selected fish by the selected slot Paint Do not forget to reset the selected fish index and mouseDragged flag In the simulation mode, each fish independent of the other ones in the fish tank swim in random order. They can move maximum one slot in each dimension at each fishTick trigger or they can stay in their current slot. If there is another fish in the slot a fish decided to move, then the fish stays in its current slot. To implement these simulation functionalities, you need to develop body of the following functions: CompareTo function of the Fish class: Compare with respect to mX values If mX values are equal, compare with respect to mY values You need to use CompareTo function in the Move, MouseDragged, MouseReleased and MouseClicked Move function of the Fish class: Randomly compute a move in x direction as -1, 0, 1 Randomly compute a move in y direction as -1, 0, 1 Compare the new slot of the fish with slots of the other fish in the tank: If the new slot is occupied, stay in the old slot, and return If the new slot is out of the tank, stay in the old slot, and return Paint function of the Fish class: Draw a filled circle in the center of the selected slot with the fish color If your fish is drawn as a nice-looking fish as follows (in minimum), then you will get 1 point bonus. Use your creativity. [login to view URL] Please pay attention that I used the Singleton Design Pattern to allow usage of global variables. It is an often used and a very useful design pattern. Please also pay attention to how we define the Fish class and how Fish class instances independent of each other behave in the Fish Tank.
รหัสโปรเจกต์: 15456094

เกี่ยวกับโปรเจกต์

3 ข้อเสนอ
โปรเจกต์ระยะไกล
ใช้งานอยู่ 6 ปีที่ผ่านมา

กำลังมองหาการสร้างรายได้ใช่ไหม?

ประโยชน์ของการประมูลกับ Freelancer

กำหนดงบประมาณและกรอบเวลาของคุณ
รับเงินจากการงานของคุณ
อธิบายข้อเสนอของคุณในภาพรวม
ลงทะเบียนและเสนอราคาฟรี
3 freelancers are bidding on average $52 USD for this job
รูปอวาตาร์ของผู้ใช้
Hi, I have many experience like this job. Relevant Skills and Experience I have 6 years of experience like this job If u hire me, i'll do best for u. Trust me. Thank u. Proposed Milestones $25 USD - Milestone
$25 USD ใน 1 วัน
4.9 (14 รีวิว)
4.8
4.8
รูปอวาตาร์ของผู้ใช้
Hello sir I have good java expertise and i would like to work on your project. Feel free to ping me. Thanks Relevant Skills and Experience Java Proposed Milestones $111 USD - Complete project
$100 USD ใน 3 วัน
5.0 (5 รีวิว)
3.0
3.0

เกี่ยวกับลูกค้า

ปักธงของ UNITED STATES
Orlando, United States
5.0
1
ยืนยันวิธีการชำระเงินแล้ว
เป็นสมาชิกตั้งแต่ ต.ค. 22, 2017

การยืนยันลูกค้า

ขอบคุณ! เราได้ส่งลิงก์สำหรับเครดิตฟรีให้คุณทางอีเมลแล้ว
เกิดข้อผิดพลาดขณะส่งอีเมลของคุณ กรุณาลองอีกครั้ง
โลโก้ Freelancer Thailand / ภาษาไทย ช่วยเหลือและสนับสนุน FreelancerประเภทโปรเจคการประกวดFreelancerองค์กรแพ็กเกจสมาชิกโครงการ Freelancer ชั้นแนวหน้าการจัดการโปรเจคงานในพื้นที่Photo Anywhereหน้าจัดแสดงผลงานAPI สำหรับนักพัฒนาได้รับการยืนยันDesktop App เกี่ยวกับเกี่ยวกับเราวิธีใช้งานความปลอดภัยนักลงทุนแผนผังเว็บไซต์เรื่องราวข่าวออกสื่อทีมรางวัลข่าวประชาสัมพันธ์ร่วมงานกับเรา ข้อกำหนดนโยบายความเป็นส่วนตัวข้อกำหนดและเงื่อนไขนโยบายลิขสิทธิ์ข้อพึงปฏิบัติค่าธรรมเนียมและค่าบริการหุ้นส่วนEscrow.comLoadshiftWarrior Forum แอปโลโก้ Apple App Store โลโก้ Google Play
ไม่สามารถคัดลอกไปยังคลิปบอร์ดได้ โปรดลองอีกครั้งหลังปรับเปลี่ยนการอนุญาต
คัดลอกไปยังคลิปบอร์ดแล้ว
ผู้ใช้ที่ลงทะเบียน งานที่มีการโพสต์ทั้งหมด
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
กำลังโหลดตัวอย่าง
ได้รับอนุญาตสำหรับตำแหน่งทางภูมิศาสตร์
เซสชั่นการเข้าสู่ระบบของคุณหมดอายุและคุณได้ออกจากระบบแล้ว กรุณาเข้าสู่ระบบอีกครั้ง