• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inheritance and interfaces  RSS feed

 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My teacher told me practise hierarchy and inheritance to write a programme that increments,decrements and resets;
1.natural numbers
2.ascii numbers
3.dates
4.hexa decimal numbers


please guys help me before tomorow thanks!
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and Welcome to the Ranch!

A couple of things to get you started off on the right foot in our community:

* ShowSomeEffort - show us what you've done so far

* TellTheDetails - give us as much information as you can about what you're trying to do and what's not going so well

* EaseUp - we're pretty easy going around here so we don't respond well to "URGENT!" requests
 
Campbell Ritchie
Marshal
Posts: 56530
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again.

What is an ASCII number?
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ascii codes
the codes behind characters & keys on the keyboard
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I imagine my first step would be defining an interface that all four of those categories can implement.
Then implement that interface for numbers.


 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
i did the first one but the rest failed
i request fo help
thank you!
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Evans wrote:Well I imagine my first step would be defining an interface that all four of those categories can implement.
Then implement that interface for numbers.

@Kithama: And indeed the other three things you mentioned.

I also think it might be worth finding out what "reset" means for a date - or indeed, a 'natural' number.

Winston
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reset -means that after incrementing & decrementing say for the dates after incrementing by 1 day for like 20times you can take it back to the original date that you started with


as for natural numbers i mean the counting numbers like 0123456789...
Thanks ;-)
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So as Junilu indicated above, you need to ShowSomeEffort and TellTheDetails

What have you got so far?
What code have you written?
What is not working about it?

Share what you've done and we can help you along the way.
 
Kithama Shadrack
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Per now i hav writte one that
increments , decrements & resets the countin numbers.
It icrement from 0 till 50 then decrements from 50-0
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!