0

Classes and objects

Let’s consider a digital wristwatch as an object. We can consider it being composed of a battery, an LCD display, time, and date. Typical operations that can be done on the watch include turning it on or off, it can turn on when the battery has enough power (> 5%). When it is on, a user can check the time, the time is displayed on the screen. They can set the time (hrs and minutes) as well as set the date (day, month, and year). The battery is rechargeable that when the watch is connected to a charger, it increases the capacity of the battery. Use this information to answer the questions that follow. .Create classes for the objects,  battery, display, time, and date. Implement their respective attributes and operational behaviours. Create a class digital clock that demonstrates the composition relationship or aggregation relationship with the classes implemented in (a). Implement a constructor that enables the initialisation of the digital clock to have the the time date and battery capacity to 90%

26th Mar 2024, 9:11 AM
Daniel Kachisuzi
Daniel Kachisuzi - avatar
9 Respostas
+ 2
your code?
26th Mar 2024, 12:27 PM
Bob_Li
Bob_Li - avatar
+ 2
Daniel Kachisuzi , I'm really not that into Java. I prefer Python. But nobody else gave you anything, so here's a link that will get you a little closer. It's the Classes section of the official Java tutorial from oracle.com. https://docs.oracle.com/javase/tutorial/java/javaOO/index.html
31st Mar 2024, 4:09 AM
Rain
Rain - avatar
0
Need help on this people
26th Mar 2024, 9:11 AM
Daniel Kachisuzi
Daniel Kachisuzi - avatar
0
In Java
27th Mar 2024, 12:07 PM
Daniel Kachisuzi
Daniel Kachisuzi - avatar
0
which programming language?
27th Mar 2024, 4:50 PM
Alhaaz
Alhaaz - avatar
0
I need some friends
28th Mar 2024, 5:12 AM
Jame—rubbe
0
I need some friends
28th Mar 2024, 5:12 AM
Jame—rubbe
0
Thanks buddy
10th Jun 2024, 8:25 PM
Daniel Kachisuzi
Daniel Kachisuzi - avatar
0
So,... I'm also not that comfortable with Java (my GF on the other hand prefers it, but she's way far beyond than me, in developing tasks), but the best version for now, I was able to build up was this: https://sololearn.com/compiler-playground/cH9fckk0xVCj/?ref=app I also tried to work work with Timer and Timertask, but I got (in kinda no time) into trouble with infinite loops... I hope this might also help set up the basic structure... ✌✚
24th Jul 2024, 2:11 AM
Konan
Konan - avatar