Home Experience and Education Project Portfolio

Project Portfolio

Java Prism Painter Project

Java Console Input

Java Input and Project Explanation

This Java program utilizes a combination of methods, arrays, and objects to form a cohesive calculator based off the input given for three quote objects displayed as messages. The purpose of this program is to calculate the total cost for a prism painter based off the given input, and other variables included such as taxes.

This program creates an array with three indices for which I use to store the three “Quote” objects in. So that we can populate each array index with a quote object, a for loop is used to achieve the desired outcome.

For the beginning of the program the user’s input is prompted for the dimensions, and error checked for anything less than 0, or greater than 100. The three dimensions are Length, Width, and Height variables which are used to store the input for calculating the total Area.

Next, the user is prompted for the budget where the output message will display whether your total is “Over budget” or “Under Budget”

The final input required is where the user is allowed to select three colors (Purple, Green, and Yellow). There will be a color charge indicated in the quote, based off the colors you have selected, and the color charge will be added into the total cost.

For example, if the user selects “Purple, Purple, Purple” the color charge will be 0%. If the user selects “Purple, Purple, Green” the color charge will be 10%, and so on with a max color charge of 20% included in the total.

For my colors, I used an ArrayList which was populated with a for loop based off another method and for loop which is used for the user’s input.

A while loop is used to error check the user’s input for anything other than the numbers 1-3 for color input. I use the ArrayList to store color strings that determine the color charge in an additional method. Finally, the total is displayed based off the calculations and other variables added into the total (such as supplies and tax).

Java Output Quote Messages