🔒 Closed Patulong naman po sa flowchart. di ko lang po kasi magets.

Status
Not open for further replies.

euls020

Enthusiast
import javax.swing.JOptionPane;
public class Nevermind {
public static void main (String[]args){

String canuel, b, byron, gender="", status="", age="";
int c;
canuel=JOptionPane.showInputDialog("Enter m/M if you're a Male and f/F if Female");
if(canuel.equals("f")||canuel.equals("F")){
gender=" Male";
}else if(canuel.equals("m")||canuel.equals("M")){
gender=" Female";
}
b=JOptionPane.showInputDialog("Enter your status s/S for Single, a/A for Married, and w/W for Widowed");
if(b.equals("s")||b.equals("S")){
status=" Single";
}else if(b.equals("a")||b.equals("A")){
status=" Married";
}else if(b.equals("w")||b.equals("W")){
status=" Widowed";
}
byron=JOptionPane.showInputDialog("Enter your age");
c=Integer.parseInt(byron);
if(c>=0&&c<=5){
age=" Baby";
}else if(c>=6&&c<=11){
age=" Kid";
}else if(c>=10&&c<=18){
age=" Teenager";
}else if(c>=19){
age=" ãdül†";
}
JOptionPane.showMessageDialog(null,"Gender:"+gender+"\nStatus:"+status+"\nAge Bracket:"+age);
}
}
yan po yung coding
 
Ahh, siyempre una yung starting(bilog o oval?) tapos declaration ng variables, sunod iinput yung gender, tapos condtion; 2 paths male or female yung assignment, gamit na lang ng on-page connector, tapos yung status naman; 2 beses magchecheck ng condition depende paano yung design, tapos sunod sa age input ng age tapos conditional ulit na maraming sanga, sa huli yung output pinagsamasamang variables, sa huli yung terminal symbol.... yun lang po,
 
parang ganto ba?
 

Attachments

  • Untitled.webp
    Untitled.webp
    23.6 KB · Views: 18
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 559
    Views
  • 2
    Participants
Last reply from:
Futility

Trending Topics

Online now

Members online
1,081
Guests online
1,186
Total visitors
2,267

Forum statistics

Threads
2,273,926
Posts
28,952,459
Members
1,234,993
Latest member
skatstip
Back
Top