|
- IT for Decision Makers Ecommerce The Internet and Business
- Cereal Genomics Workshop
- Gauss exercises II:
- Gauss exercises II:
- Gauss exercises II:
- Scientific terminology,ศัพท์วิทยาศาสตร์16
- Scientific terminology,ศัพท์วิทยาศาสตร์15
- Scientific terminology,ศัพท์วิทยาศาสตร์14
- Scientific terminology,ศัพท์วิทยาศาสตร์13
- Scientific terminology,ศัพท์วิทยาศาสตร์12
- Scientific terminology,ศัพท์วิทยาศาสตร์11
- Scientific terminology,ศัพท์วิทยาศาสตร์10
- Scientific terminology,ศัพท์วิทยาศาสตร์9
- Scientific terminology,ศัพท์วิทยาศาสตร์8
- Scientific terminology,ศัพท์วิทยาศาสตร์7
- Scientific terminology,ศัพท์วิทยาศาสตร์6
- Scientific terminology,ศัพท์วิทยาศาสตร์5
- Scientific terminology,ศัพท์วิทยาศาสตร์4
- Scientific terminology,ศัพท์วิทยาศาสตร์4
- Scientific terminology,ศัพท์วิทยาศาสตร์3
- Scientific terminology,ศัพท์วิทยาศาสตร์1ศัพท์วิทยาศาสตร์
- Scientific terminology,ศัพท์วิทยาศาสตร์
- T-algebra Intelligent Environment for Expression Manipulation Exercises
- ILLUSIONS: Experiential Exercises
- CREATING INTERESTING EXERCISES, AND MAKING BORING EXERCISES INTERESTING
- INTRODUCTION TO THE BIOLOGY LAB AND LABORATORY SAFETY
- LABORATORY EXERCISES #4 PART I: OBSERVING LIVING PROTISTS: LETS PLAY LEEUWENHOEK
- Laboratory: Exploring Sustainability in Agriculture
- When Evaluations Do Not Function as Learning Exercises:2
- When Evaluations Do Not Function as Learning Exercises:
- Part 2 Working with Tools
- Lecture 4 Exercises Writing Applications
- BIOLOGY 3449: LIBRARY ASSIGNMENT
- Part 2: ARTIFICIAL POPULATIONS
- MARK - RECAPTURE POPULATION ESTIMATION
- Medical Biology Core Labs 2008-2009
- Developed by Julie Clayton, HIV/AIDS co-ordinator for the Science and Development Network, with cont
- PubMed Hands On Lab Time
|
|
|
|
|
Lecture 4 Exercises Writing Applications
Lecture 4 Exercises Writing Applications Part 1 Writing Command-Line Applications Programming Tips The length of an array can be checked with its length property, i.e. arrayName.length Use the System.out.println(
) method to write to the console. Use the System.exit(
) method to exit the application. A parameter of zero means a normal exit, a parameter of one means an error was encountered. To convert a String into an integer use the Integer.parseInt() method String constants can be declared as: public static final String MY_STRING = myStringValue; Use the new operator to create a new object, e.g. new Calculator(x, y). The Javadoc for the Java API can be found at: //java.sun.com/j2se/1.4.1/docs/api/index.html Exercises
1. Write a simple application that when run simply writes out Hello World to the console. 2. Write a simple application that loops through the array containing its command-line parameters, writing each of them to the console (Tip: check the javadoc for java.lang.String): a. In upper case b. and include the length of each string. 3. Write a simple command-line calculator as described by the UML diagram below. The calculator should be able to accept the following command line parameters: a. The first number b. An operator. One of the following strings: plus, minus, times, divide c. A second number The calculator should then print out the results of the calculation. If an incorrect number of arguments are provided, or the user types in an unknown operator, then the program should exit with an appropriate message.
Create Date : 06 กุมภาพันธ์ 2554 |
Last Update : 6 กุมภาพันธ์ 2554 8:54:59 น. |
|
0 comments
|
Counter : 956 Pageviews. |
|
|
|
| |
|
|