Then is there a way that I can extract the fractional part away from that double? My main objective is, if I have an imported double variable with any value, say 3.45, then somehow get a variable...
Type: Posts; User: jean28
Then is there a way that I can extract the fractional part away from that double? My main objective is, if I have an imported double variable with any value, say 3.45, then somehow get a variable...
Hey guys,
I have a number type double and want to split it up into its integer and fractional parts. For example, if I have 3.45 i want a variable that has 3 and another one that has 45.
I...
Hey guys,
I am trying to create a simple java program that prints out the date that was submitted. I started playing around and noticed that the Calendar class prints exactly what I want....
It is okay. I already got it :)
@Override
public Polynomial add(Polynomial P2)
{
PolynomialImp P3 = new PolynomialImp();
for(Term t: P2)
{
I did that loop that you wrote here:
for(int i = 0; i <= this.terms.size() - 1; i++)
{
if(this.terms.get(i).getExponent() >= 0)
{
P3.addTerm(new...
I have an ArrayList terms with various polynomial terms inside. This is what is inside:
So there are 4 elements inside the array. Each one has their own coefficient and exponent.
I want to...
I am making a programming project that implements terms for polynomials. For example, if I put "7x^3+4x^2", then the class has an inner array list that stores "7x^3" and "4x^2". However, I need to...
Hey guys I wanted to know if someone could tell me what I'm doing wrong here. I need to implement the methods of an ArrayList, and I was doing great until I had to implement the remove() method.
...
Hey guys. I've searched everywhere trying to make a small application that returns my current localization. Ideally I would like to see it in Google maps, but latitude and longitude would do. I have...
I think that this one should work, but for some reason it doesn't. Does anything clear seem wrong now again?
public static boolean isDifferent(float[] array)
{
float temp;
boolean count...
I tried to do another for loop but this one always gives me false (reasonable, considering that if I loops through it I will always find the value that I stored in temp. How do I fix this?
I put array.length - 2 and it worked :) thanks.
Hey guys, I am trying to write a program that takes an array of float values and determines if all the numbers are different for each other. I am trying to set a temp variable that stores the value...
In my class the professor was showing us a "Bag" program that he was writing and it was a collection. He told us that a way to be able to iterate the Bag program was to put a subclass called...
So I will always need to implement the iterator interface if I am making my own collection?
I am a bit new to for each loops and I'm trying to understand what are the main differences between them when working with arrays. Is there any particular set where the for each is more convenient?...
How can I make a java program that is an .exe file that runs without opening Eclipse? Does anybody know?
Thanks very much.
Hey guys. I am new to Android and I was trying to make a new AVD in eclipse but for some reason the program wont let me do it. I have already installed countless Android SDK's (from 3.0 to 4.2) but...
What about that variable "reader" ? What can I do with it?
Could anyone explain to me the use of an abstract class and why I would prefer them over an interface?
As far as I understand, both contain empty method declarations, except that you can implement...
Hey guys, I have a few doubts about the finally clause in exception handling.
What exactly does it do? Does it need to have try and catch blocks before it in order to work?
I just can't seem...
Thanks a lot guys, for some reason the program ran just fine after I saved it for some reason...
Hey guys, I have a super class and a class that extends it. For some reason, the variable cur doesn't work in the extended class even though it should work just fine. The errors are in the...
Thank you very much!
Hey guys I have a quick question. Could anyone explain to me what the += does and how it works? I have seen it in different examples that use arrays but I still don't get what it's supposed to do.
...