## moy2414's Profile User Rating:

Reputation: 3 Apprentice
Group:
Members
Active Posts:
18 (0.03 per day)
Joined:
25-January 12
Profile Views:
606
Last Active:
Aug 02 2012 08:37 PM
Currently:
Offline

### Previous Fields

Country:
US
OS Preference:
Who Cares
Favorite Browser:
Safari
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Playstation
Dodge
Dream Kudos:
0

### Latest Visitors

moy2414 Just finished writing my first recursive set of code, and it worked! I feel accomplished.

1. #### In Topic: Simple Quadratic Equation Solving Program?

Posted 31 Jan 2012

macosxnerd101, on 31 January 2012 - 06:53 AM, said:

Quote

I'm assuming that the capital "B" in this line is supposed to be lowercase.

It's a known forum bug.

Oh ok my bad. I'm new to the forum so I had no idea =) haha Thank you for telling me!
2. #### In Topic: Printing a Diamond

Posted 31 Jan 2012

Here's a fun fact that will save you time whenever you have to display multiple items.

Instead of having to type: System.out.print();

You can import the following tool before creating your class:
```import static java.lang.System.*;

```

Now all you have to type is:

out.print();

Just a fun fact that I found very useful (mostly just fun to know)!
3. #### In Topic: Simple Quadratic Equation Solving Program?

Posted 31 Jan 2012

I'm assuming that the capital "B" in this line is supposed to be lowercase.
```double discriminant = (b*B)/> - (4.0*a*c);
```

and here as well:
```System.out.println((-c/B)/>);
```

An error I can see is that in certain cases, you are attempting to take the square root of a negative number when you assign (double d) a value.

Instead of always finding the discriminant before the if statements, try the following:
```if(a==0.0)
{
}
else
{
if(the discriminant is greater than or equal to zero)
{
// assign the variable d the value of the square root of the positive discriminant
//keep rest of code to display positive and negative answer
}
else
{
// Don't solve for the square root of negative discriminant.
//simply display that answers are imaginary.
}
}

```

Hope this helps!
4. #### In Topic: Java Regex Challenge - 1

Posted 29 Jan 2012

Here is my first attempt. Looking at everyone else's makes mine seem very amateur haha but atleast mine works.

Easy
```public static boolean isValid (String password)
{
return false;
return false;
else
return true;
}

```

Hard
```public static boolean isValid2 (String password)
{
return false;
return false;
else
{
int numCount=0;
int capitalCount=0;
{
numCount++;
capitalCount++;
}

if(numCount>=2 && capitalCount>=1)
return true;
else
return false;
}
}

```
5. #### In Topic: toString()

Posted 27 Jan 2012

Can you just make a global ( I doubt thats the proper term but it will have to do) variable outside of the constructers and methods? Create a variable and set it equal to what you want to display. Then you can keep the toString method you put in the last comment and it should return the value because the variable you are sending is not a local one.

### My Information

Member Title:
Age:
20 years old
Birthday:
September 10, 1993
Gender:
Full Name:
Moises Holguin
Years Programming:
3
Programming Languages:
Java

### Contact Information

E-mail:
MSN:
moy2414@hotmail.com
http://facebok.com/leavethescene

### Friends

moy2414 hasn't added any friends yet.