Search:

Type: Posts; User: kennylty

Search: Search took 0.08 seconds.

  1. 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. Replies
    1
    Views
    1,850

    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. [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. [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. 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. Replies
    6
    Views
    1,241

    [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. 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. Replies
    6
    Views
    1,241

    [SOLVED] Re: Decimal to hex problem

    but if i change it to


    while (dec>=0)

    it does not return the println at all.
  9. Replies
    6
    Views
    1,241

    [SOLVED] Re: Decimal to hex problem

    Thanks for the reply, this is my first post
  10. Replies
    6
    Views
    1,241

    [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