Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
DCS-100: Procedural Programming Instructions for week 1 labs Log into your designated machine under Linux (both of you will ultimately need to do this, but just one should do it at first). If the machine is currently running Windows, then you will need to reboot it. Get help if necessary. Start a shell from the monitor (little box) icon on the menu bar at the top. Inside the shell window type the following command: mkdir prog1 This creates a new directory for you called prog1. This should be the directory you do your work in Then type: cd prog1 This moves you so that you are working in that directory (as far as THIS shell is concerned). We are using Brinch Hansen's I/O library. Java's default libraries are designed for general use, and are not suitable for the simple kind of text-based IO we are doing. To start you will need to download the library and install it. (If you have a computer at home you can also install both Java and the library there too.) You get that from the DCS100 web pages... Start Mozilla (a web browser) from the red star on the menu bar, and find the DCS100 web page. You get there from the DCS100 course web page on the intranet. At the bottom of the page is a link to "Brinch Hansen's text program for Linux" Save that program to your prog1 directory as a file called text.java That file is your first Java program. It contains some useful things that will make it easier to write your own Java programs. With any Java program the first thing you have to do is "compile" it. That means turn it from a form a human can read to a form the computer can read. In your shell type javac text.java to compile it. Some new "class" files will have been created in the directory (you can see them by typing ls). Type java text to run this program. That should have set up the special libraries you need for the course. It also creates a Java program called "test". Check this has happened by typing java test to check it is working. That runs the test program - do what it asks you to do. You are now ready to do your own programming... Go back to Mozilla and save copies of the week 1 programs from the website into your directory. You might want to try and compile and run them...and try and work out what they do... Now start the week 1 non-assessed exercises from the web page. Start an editor (eg gedit, or emacs) from the utilities submenu of the programs menu on your menu bar. Remember to save files to your prog1 directory. Do the exercises! When you are confident with the non-assessed exercises do the first assessed exercise (on your own), then get it marked by your tutor. When you have finished remember to logout using the logout on the System menu. Do not just turn the machine off! Any exercises you did not finish you are expected to complete in your own time before the next lab. If you do not you will start to struggle with the course very quickly. If you havent already done so you should also read and send a hello message to the DCS discussion group and also make sure you can send and read emails - send one to you neighbour.