Sie sind auf Seite 1von 2

Exercise 1

Describe what is meant by a computer program. A piece of software containing statements and commands that tell the computer to perform a task or function.

Exercise 2
Describe the advantages for the programmer of a context sensitive editor. users can quickly find information about how to be most effective, which will increase their satisfaction with your tools.

Exercise 3
Explain the advantages of Graphical User Interfaces as compared with text based interfaces. 1) Windows 2) Icons 3) Menus 4) Pointer The biggest difference is that CLI don't use graphics.. Also in CLI you manually have to enter the command whereas in GUI you may have buttons and menu.. CLI does not supports Mouse.. A graphical user interface uses graphics, such as pictures and icons the user can select (eg click on) to run commands. A command-line interface has a space or line on which text based inputs (commands for the computer) can be typed, so the user must have existing knowledge of valid commands.

Exercise 4
Describe what is meant by a Class in the Java programming language. In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is the blueprint from which individual objects are created.

Exercise 5
Distinguish between a Class and an Object. A class is basically a definition, and contains the object's code. An object is an instance of a class. For instance, there is one java.lang.String class, but you can instantiate any number of distinct java.lang.String objects (instances). While a class defines the instance variables than an object has, the instantiated object itself actually contains those variables. So to put it simply: An object is an instance of a class.

Exercise 6
Illustrate how variables are declared in a Java Program. To declare a variable in Java, all that is needed is the data type followed by the variable name: For example byte nextInStream; short hour; long totalNumberOfStars; float reactionTime; double itemPrice;

Exercise 7
Illustrate two methods that could be applied to a string variable. Method1: char charAt(int index) Returns the character at the specified index. Method2: int compareTo(Object o) Compares this String to another Object.

Exercise 8
Produce a Java project that would display a useful conversion table to compare four currencies public class TodayCurrency { public static void main( String args []) { System.out.println("1 USD = 855.49 KS"); System.out.println("1 SGD = 700.93 KS"); System.out.println("1 GBP = 1089.12 KS"); System.out.println("1 CNY = 137.28 KS"); }}

Das könnte Ihnen auch gefallen