• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with an assignment please  RSS feed

 
Nilesh Sanyal
Ranch Hand
Posts: 33
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A program to create a class that contains a method that accepts compass directions and displays the same. You need to ensure that the method must accept any one of the directions: NORTH, SOUTH, EAST, WEST, NORTHEAST, SOUTHEAST, SOUTHWEST or NORTHWEST.
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, Nilesh.

Folks here are eager to be helpful, but they won't just do the assignment for you, nor does anyone just assume you want them to do it for you. Instead, what works well here is if you post the code you have so far, and then ask for help in getting it to do what you want. Usually, people will give you suggestions and examples that will, in the end, let you solve your problem and complete your assignment yourself.

So, give it a try and post your first attempt at writing this program. Then we'll see what we can do.
 
Mauro Trevigno
Ranch Hand
Posts: 99
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to do your assigment step by step, you start coding and search on the web if you got stuck in some part of your code, to see how it works.

Regards,
-M
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nilesh, welcome to the Ranch.

This sounds like a task where an enum type would be exactly what you would want to use. Please give it a go and if you get stuck, show us how far you've got and we'll explain things.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!