Please read the assignment carefully. If you need help, don't hesitate to contact your E-TUTOR, but send the email EARLY, NOT just before the deadline. You can also see the lab tutor or the Professor during their office hours. Even though this is the first assignment, it uses concepts from all of Chapters 2 through 5. However, you do not need to read all of these chapters yet. Read the parts you need, especially Sections 3.3 for the if statement, Section 4.4 for the for loop and pages 37-40 for the Scanner class. We have discussed all of this in class.
Decimal numbers from 0 through 255 can be represented in the binary number system using 8 bits. Here are some examples:
This assignment asks you to write a Java class called Binary. The decimal number will be stored in the variable num declared in the main method. The class Binary will have two methods that you must write. Here are the details.
After your program runs properly, alter it slightly so that it can read the data from the command line. If you have a mac, the terminal program gives you the command line. If you have a PC, and are using JCreator see the Arguments Prompt section in the Downloading the Compiler (Version 1.6) and the IDE link. Otherwise, see http://www.computerhope.com/issues/ch000549.htm (the link is on the web page under the assignment) for how to include the java and javac programs in your path. However, the easiest way is to place your program in the Bin directory of the jdk directory. Hand this version into your etutor. To see how the command line works, look at the link How to use the command line part of the assignment for this assignment. If you can't get this version to work, 0.2 points will be deducted from a possible high of 4.0 points.. You should hand in two versions of the assignment. One that uses the Scanner class and one that uses the command line. The command line version should not check whether your input is in range using a do while since you can only input data from the command line when you execute the program.
Please get started on the assignment immediately, and contact the etutor as soon as possible with any questions. Don't expect a response the day before the due date. Late homeworks will be accepted up to 7 days late, but they will be marginally penalized.