ECPI School Portfolio

Ted DeJong

Java I

PRG113 Programming I

In this course, we used Java How to Program, 6th ed., by Harvey M. Deitel and Paul J. Deitel. This course was used to provide further experience using the object-oriented programming paradigm and to introduce experience in the Java programming language.

PRG114 Programming II

Also see my projects from the follow-up course, Java II.

Please Note

All of my Java programs require that you have Java Virtual Machine installed on the computer you are using. Starting these programs is a little technical. Please click Help for more detail on this process and help setting up and using these project files.


This program sets up two accounts with initial balances. Then it allows the user to withdraw or deposit to the accounts. Next it gives the user feedback and informs them of what kind of transaction took place and then displays the updated balances.

The instructor wanted students to start with an example from the text, add a debit method, and test it.

In this assignment, I was to create a class file named "Account" with a constructor to initialize instance variable balance. Included is a credit method and a debit method to manipulate the balance variable in the object. The program should ensure the withdrawal amount does not exceed the account balance. If it does, the balance should not change and the program should print "Debit amount exceeded account balance".

Then a class file named "AccountTest" was made to use the Account class to create and manipulate Account objects.


This assignment required that I create my own program of my own design and with no kind of example as reference. The assignment set up a somewhat tangible exercise, but I felt like it was not very realistic. For example, it required methods to change varibles like price and item description, which is not what you would want a customer to do to an order form.

I decided to make a more realistic kind of interactive program to simulate an invoice order form. First, it displays a catalog of items to purchase and instructs the user to choose 2 items. Then it displays the customer's order with totals.

Note that I intentionally put an entry in the catalog that has an improper amount (it is negative) to demonstrate how the program would handle the error. The wrench item displays an amount of 29.95, but the item is created with an amount of -29.95. So, if the user orders a wrench, an error message is displayed in the final customer's order with totals output.

If the program is run in the alternate test mode, the user can test out all the methods (like changing the price) of the Invoice class, as the assignment requires.

The instructor wanted students to use four parameters on the constructor, four "set" methods, four "get" methods, etc.

In this assignment, I was to create a class file named "Invoice" that a hardware store could use for an invoice for items sold. The Invoice class should include 4 instance variables (string, string, int, double). Included is a constructor to initialize the 4 instance variables.

The class should also include "get" and "set" methods for each of the 4 instance variables. Also provided is a method, "getInvoiceAmount" that calculates the invoice item amount.

If the quantity or the price is negative, it should be reset to 0.

Then I was to create a class file named "InvoiceTest" to demonstrate all of class Invoice's methods.


This program creates a new window and draws a fan of 15 lines on a panel. The image changes dynamically to scale depending on the size of the window.

The instructor wanted students not to use height or width.

In this assignment, I was to use loops and control statements to draw lines. I needed to design the program to create 15 lines that fanned from a single point in the upper-left corner of the display. The image needed to scale when the window was resized.

Note that the instructor did not require us to scale the image as the window is resized.


This program creates a new window and square on a panel. Although not required, I designed it so that the image changes dynamically to scale depending on the size of the window.

My instructor had us modify the program in the book which would draw an "X" in a window. He wanted it modified to draw a square instead and told us not to worry about making the image rescale when the window resized.


This program calculates the area and perimeter of a rectangle, given its width and height.

Develop an application (meaning one .java and one .class file) that will input the two (distinct) sides of a rectangle, and then compute and display its perimeter and area. Sides are expected to be integers.

Before data entry, display a short message informing the user as to the purpose of the program and what is expected of him/her.

All inputs should be accompanied by an appropriate prompt so the user will know what to enter from the keyboard. The results should also include an appropriate short description.


This program creates a new window and pentagon on a panel. Although not required, I designed it so that the image changes dynamically to scale depending on the size of the window.

Drawing from [previous examples] in the book, develop a class and application that will draw a five-sided object.

The object should have five "corners" (not necessarily 90 degrees); there should be no endpoints "hanging out" (all endpoints should be connected to some other endpoint).

The object does not have to scale as the frame is made larger and smaller.

More Java Projects

There are more Java projects from my next Java course, Java II.