# Search:

Type: Posts; User: kennylty

1. ## Thread: OOP composition - MyPoint and MyTriangle. need hint for building MyTriangle class

by kennylty
Replies
1
Views
199

### OOP composition - MyPoint and MyTriangle. need hint for building MyTriangle class

Basically i need to build this MyTriangle class. together with the code from MyPoint, i need to test out the following.

2757
when i try to build the constructor part where v1 = (x1, y1) it says...
2. ## Thread: Time class - previousSecond()

by kennylty
Replies
1
Views
153

### Time class - previousSecond()

im unable to work out my previousSecond() in Time class.

here is my code:

}void setHour(int hour){
if (hour >= 0 && hour <= 23){
this.hour = hour;
}else{
3. ## Thread: Why raiseSalary equation can't work? empolyee.java

by kennylty
Replies
2
Views
142

### [SOLVED] Re: Why raiseSalary equation can't work? empolyee.java

I am able to do it by adding a (double). thanks for the help.

}public void raiseSalary(int percent){
salary *= (double)(100+percent)/100;
4. ## Thread: Why raiseSalary equation can't work? empolyee.java

by kennylty
Replies
2
Views
142

### [SOLVED] Why raiseSalary equation can't work? empolyee.java

why in raiseSalary(): salary *= (100 + percent) / 100 won't work?

// why salary *= (100+percent)/100 wont work?
}public void raiseSalary(int percent){
salary =...
5. ## Thread: hex to binary - how do i flush off the leading 0

by kennylty
Replies
5
Views
170

### Re: hex to binary - how do i flush off the leading 0

I understand that i need to use String's indexOf() and substring(). But just how am i gonna insert into my code
6. ## Thread: Decimal to hex problem

by kennylty
Replies
6
Views
141

### [SOLVED] Re: Decimal to hex problem

Wow! i got it already. thanks so much. Need to read up the different uses of loops again
7. ## Thread: hex to binary - how do i flush off the leading 0

by kennylty
Replies
5
Views
170

### hex to binary - how do i flush off the leading 0

any idea how do i flush off the leading 0s from my results? I want to start with 1.

import java.util.Scanner;

public class Hex2Bin {
public static void main(String[] args) {...
8. ## Thread: Decimal to hex problem

by kennylty
Replies
6
Views
141

### [SOLVED] Re: Decimal to hex problem

but if i change it to

while (dec>=0)

it does not return the println at all.
9. ## Thread: Decimal to hex problem

by kennylty
Replies
6
Views
141

### [SOLVED] Re: Decimal to hex problem

Thanks for the reply, this is my first post
10. ## Thread: Decimal to hex problem

by kennylty
Replies
6
Views
141

### [SOLVED] Decimal to hex problem

Why do i not get a value 0 when my input is 0.

import java.util.Scanner;

public class Dec2Hex {
public static void main(String[] args){
int dec;
String hexStr = "";
Results 1 to 10 of 10