Java程序辅导

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

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
Lab 4 
 
Name: 
 
To be completed in the lab on Friday 04/29/11 or next Friday 05/06/11.  
 
Copy the file lab_4.zip from our course website: 
http://www.cs.drexel.edu/~knowak/cs265_spring_2011/cs_265_links.htm 
to your desktop and unzip it. Open a SSH connection with dunx1. Use SSH file transfer 
window to copy Lab 4 files into your cs265_ spring_2011 directory on dunx1. In order to 
achieve this task drag the lab_4 file icon from your desktop into your 
cs265_ spring_2011 directory on dunx1. All files and subdirectories will be automatically 
copied.  
 
Compile and run all the programs prepared for Lab 4. Describe briefly the target of each 
of the programs. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Prepare and run a Java program, which takes integer arguments from the command line 
and prints out their cubes. 
 
Ask the instructor/TA to verify your work. 
Instructor/TA’s initials: _____ 
 
Prepare and run a Java program, which prompts the user for input strings and prints out 
their reversals. You may find it convenient to access the documentation of String class 
while working on this task: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html 
 
Ask the instructor/TA to verify your work. 
Instructor/TA’s initials: _____ 
 
 
 
Run the Java program you prepared for Lab 4. Your program should follow the stages:  
 
• Takes an input integer n as a command line argument. 
• Creates a random integer array of size n and performs sorting by two 
versions of the Quick-Sort method: the first one should be based on comparing 
numbers with the relational operator <, and the second one should make use of the 
interface Cmp. 
• Times both sorting procedures. 
• Reports timing result. 
 
Ask the instructor/TA to verify your work. 
Instructor/TA’s initials: _____