For this assignment, I had to create a program that could write Java code using the Java programming language. The program that I wrote did not have to create code that worked, however, it did need to create a random string of text in the Java syntax that looked like a Java program without the proper indentation and formatting.
An example of an output from the program looks like:
while ( a > 9 ) { method2 ( a , c ) ; method0 ( e ) ; i = 26 ; d = b ; method5 ( 67 ) ; method7 ( 49 ) ; method0 ( b ) ; method8 ( 52 * b ) ; method5 ( c ) ; }
which looks like this after formatting it manually:
while ( a > 9 ) {
method2 (a , c);
method0 (e);
i = 26;
d = b;
method5 (67);
method7 (49) ;
method0 (b) ;
method8 (52 * b);
method5 (c);
}
The purpose of this assignment was to practice implementing a class hierarchy in Java, as that was what we were learning in class at the time. This project really helped make me understand how classes and inheritance work. This assignment really helped me understand how OOP works as this assignment was based around OOP and made me utilize all the features that come with OOP.
I was responsible for writing all the code in this project, however I did most of the work with my friends when developing this. We bounced ideas on how to implement this assignment and the benefits in creating our code a certain way. Eventually, I decided to implement my code the way I did, because it made the most sense to me and it best utilized class inheritance in Java. Our professor also included some base code that he wanted us to build upon which I used in this assignment.
Here is a link to the source code for this project: Mini-Java src