🔒 Closed Mga programmer need ng konting tulong

Status
Not open for further replies.
tatlong decision agad pababa? or same padin ng ginawa ko hiwa hiwalay?
yup pababa.. pababa dalawang dicission nga lang pala hindi talo. halimbawa Fnum > Snum sa True output kana agad "First number is greater than the second" then END, sa False naman idugtong mo ung dicission na Fnum < Snum pag mag true pa yan ouput ka ulit "First number is less than the second" then END, sa False naman out put ka agad "First number is equal to the second"(kac kung hindi less than or hindi greater than ibig sabihin equal sila, di kilangan ng ikatlong dicission) then END.

gets??
 
yup pababa.. pababa dalawang dicission nga lang pala hindi talo. halimbawa Fnum > Snum sa True output kana agad "First number is greater than the second" then END, sa False naman idugtong mo ung dicission na Fnum < Snum pag mag true pa yan ouput ka ulit "First number is less than the second" then END, sa False naman out put ka agad "First number is equal to the second"(kac kung hindi less than or hindi greater than ibig sabihin equal sila, di kilangan ng ikatlong dicission) then END.

gets??
hehe eto yung nagawa ko pa check kung tama *^*
You do not have permission to view the full content of this post. Log in or register now.

You do not have permission to view the full content of this post. Log in or register now.

You do not have permission to view the full content of this post. Log in or register now.

You do not have permission to view the full content of this post. Log in or register now.

di koi alam kung san yung tamadiyan pero maraming salamat at
madaming pumasok na idea sa utak ko *^* THANK YOU MUCH*^*
sana ma tulunga mo po ako ulit next time *^*
 
yup pababa.. pababa dalawang dicission nga lang pala hindi talo. halimbawa Fnum > Snum sa True output kana agad "First number is greater than the second" then END, sa False naman idugtong mo ung dicission na Fnum < Snum pag mag true pa yan ouput ka ulit "First number is less than the second" then END, sa False naman out put ka agad "First number is equal to the second"(kac kung hindi less than or hindi greater than ibig sabihin equal sila, di kilangan ng ikatlong dicission) then END.

gets??
tama yung baba yung taas lang mali ...bago umabot ng decision block *^* salamat ulit ng marami
 
tama yung baba yung taas lang mali ...bago umabot ng decision block *^* salamat ulit ng marami
bakit naka set na yung mga value dun?? anu po ba ung program?? given na ang mga value? o ee'input pa ng user..??

may nakalagay kana dun na 5 and 1, 3 and 2 , 4 and 4..
 
Sa java ba ito ts ? kung hindi iconvert mo nalang sa programming language na gamit mo basta intindihin mo nalang yung logic, try mo sana makatulong.
Code:
import java.util.*;
public class Numbers{

    String num, msg = "First";  //ang variable num ay ang mag sisilbing temporary storage for entering values of first and second number;
    int[] n = new int[2];         //n[0] is the first number and n[1] is the second
    int i = 0;             //gagamitin ito para sa while loop statement
    Scanner in = new Scanner(System.in);

    public void enterValues(){
        while(i < 2){
            System.out.print("Pls Enter " + msg + " Number: ");
            num = in.next().trim();
            if(num.matches("\\d+")){         //determine whether the entered values is a number or a character
                n[i] = Integer.parseInt(num);
                msg = "Second";
                i++;
            }else{
                System.out.println("Invalid Input!");
            }
        }
        if(n[0] > n[1]){
            msg = "GREATER than";
        }else if(n[1] > n[0]){
            msg = "LESS than";
        }else{
            msg = "EQUAL to";
        }
        System.out.println("First Number is " + msg + " Number Two.");
        in.close();
    }

    public static void main(String[]args){
        Numbers n = new Numbers();
        n.enterValues();
    }
}
 
Sa java ba ito ts ? kung hindi iconvert mo nalang sa programming language na gamit mo basta intindihin mo nalang yung logic, try mo sana makatulong.
Code:
import java.util.*;
public class Numbers{

    String num, msg = "First";  //ang variable num ay ang mag sisilbing temporary storage for entering values of first and second number;
    int[] n = new int[2];         //n[0] is the first number and n[1] is the second
    int i = 0;             //gagamitin ito para sa while loop statement
    Scanner in = new Scanner(System.in);

    public void enterValues(){
        while(i < 2){
            System.out.print("Pls Enter " + msg + " Number: ");
            num = in.next().trim();
            if(num.matches("\\d+")){         //determine whether the entered values is a number or a character
                n[i] = Integer.parseInt(num);
                msg = "Second";
                i++;
            }else{
                System.out.println("Invalid Input!");
            }
        }
        if(n[0] > n[1]){
            msg = "GREATER than";
        }else if(n[1] > n[0]){
            msg = "LESS than";
        }else{
            msg = "EQUAL to";
        }
        System.out.println("First Number is " + msg + " Number Two.");
        in.close();
    }

    public static void main(String[]args){
        Numbers n = new Numbers();
        n.enterValues();
    }
}
salamat po dito kaso wala pako dito *^* but thanks for the help po ng effort *^*
na tuwa ako dito yung nasa isip ko same dito in flow chart mode nga lang *^*
 
Status
Not open for further replies.

About this Thread

  • 27
    Replies
  • 1K
    Views
  • 6
    Participants
Last reply from:
neth23

Trending Topics

Online now

Members online
405
Guests online
1,219
Total visitors
1,624

Forum statistics

Threads
2,274,114
Posts
28,953,735
Members
1,235,083
Latest member
Zrob69
Back
Top