So I'm trying to figure out how to create Arrays out of Objects but I'm having a problem adding an Object to an Array.
Here's what I have:
public class Main {
double[] values = new...
Type: Posts; User: bengregg
So I'm trying to figure out how to create Arrays out of Objects but I'm having a problem adding an Object to an Array.
Here's what I have:
public class Main {
double[] values = new...
I'm working on creating a Calculator. The code is not finished yet but I'm getting an error already at a part I need to work in order to continue building the program.
I can type in numbers fine,...
How do you instantiate an anonymous class?
Lol so I have no errors now. The only problem is nothing happens when I Choose an option form the Combo Box nothing happens :(
public class ThreeColorsFrame extends JFrame {
private JPanel...
So I'm trying to get the action listener right but I get a ; Expected error at the second to last }. What am I doing wrong?
public void createComboBox()
{
JPanel northPanel = new...
So I'm working on a program to change the Color of a Panel with a Combo Box.
So far I have the Panel and the ComboBox with th options. However, when you click the option nothing happens. This is...
Lol I'm trying to seperate the program into classes now.
The program works, it takes a file and counts the number of lines, words, and characters:
import java.io.File;
import...
But the program works none the less. Now I'm just working on separating the program into classes so it is object oriented.
I have My getWords
import java.util.Scanner;
/**
*
Lol nevermind silly mistake I got it...
int lineNumberAgain = 1;
int totalChars=0;
while (three.hasNextLine())
{
String lineagain = three.nextLine();
int lineChars = lineagain.length();...
I know but the problem I am gaving is with int totalChars = lineChars + totalChar; (used to be int Total = howLong + Total;
) because it says that totalChars is not initiated. When I initiate...
lineNumberAgain starts at the first line and for every loop it goes to the next line. The total is supposed to keep track of the total number of characters.
Lol, almost there.
Here is what I have for the find Characters:
File inputFileThree = new File(inputFileName);
Scanner three = new Scanner(inputFileThree);
Hey thanks for the advice. For some reason I thought I couldn't change System in, I thought it needed to be together for whatever reason. So I got it so it can count the lines and words now. However,...
So the point of the program is to input a file and have the program generate the number of lines, characters, and words. As of right not I can generate the lines and the words. However, I cannot...
So I'm trying to use two validations in my program:
5 integers for the first Validation and
the second is 32 characters only including : and |.
The first validation is for a Zip Code and the...
Okay so I'm making progress...
I set the purchase at .25 and Pay with 1 penny, 1 dime, 8 quarters, and 1 nickel ($2.16)
So I should get back 1.91
Here is the Output
The Change Due is:...
So I put the code in the givechange() method instead and it gave me the result of 25.
I found out this result is the total amount of coins to give back.
return dollarsint + quartersint + dimesint +...
Okay So I went back and had the doubles converted to ints. Lol, however, I had to convert them back to double so the equations would work. I'm error free however, when I call the method it gives me...
I am working on a program where you have to give change in coins. The program already gives the change amount, I'm just trying to figure out how to give the change in coins. This is what i have so...
Lol wow. Thank you very much Newbie, I appreciate it.
I am working on a Object Oriented Program that gives change for a certain Purchase. You give it the purchase amount and the coins and amount of coins that you are paying with.
The problem is that...
I just started my second quarter of Java. I'm in Java 2 now anyways I was given this as my first assignment:
Implement a Class Polygon that contains an array List of Point2D.Double objects....