Activity 4

in #honouree2 years ago

Java was the primary programming language in this class. The class started with installing Visual Studio Code, JDK, and Java Pack so the class could get on right away with coding Java codes. Simple inputs and outputs within a program can be performed with many sets of classes and methods Java provides. For Graphical User Interface design,
Java has provided classes with pop-up windows and pull-down menus, and even methods for displaying inputting text, integers, graphical objects, images, sounds, web pages, and mouse events. These input and output mechanisms can be used for stand-alone programs or in applets.

Java has a built-in static object (System.out) that shows the "standard output" device. This object is an instance of java.io.PrintStream class. This class
characterize methods that characters are put in a temporary location, which is a buffer, which is then unloaded when the console is ready to print.

System.in performs input from the Java console window. If the System.out shows the "standard output" device, here System.in object is associated with the "standard input" device, which by default is the computer keyboard typing its typed characters to the Java console. The scanner class has several convenient methods that read the keyboard input by the user. The scanner class reads the input and divides it into tokens, which are contiguous strings disparated by delimeters, which are special seperating characters.This class includes following methods for dealing with tokens. Such methods are hasNext(), next(), hasNextType(), nextType(), hasNextLine(), nextLine(), findinLine(String s).

The class made an example program dealing with the methods mentioned above. This program contained two classes which were CreditCard class and Test class. Credit Class contained defined five instance variables, which were all private to the class and it provided a simple constructor that initializes these instance variables. While the Test class was to test the CreditCard Class in the Test class.

Furthermore, the class was given activities that were based on the topics mentioned above which made the class easier to go by.

Posted using Honouree