🔒 Closed Patulong po sa coding :)

Status
Not open for further replies.

euls020

Enthusiast
Write JOption program that determines the gender, status and age bracket of an individual based on the ff.

m/M = Male
f/F = Female

s/S = Single
ma/Ma = Married
w/W = Widowed

0-5 = Baby
6-11 = Kid
12-18 = Teenager
19 and above = ãdül†

salamat po sa tutulong. :)
 
cge ser...kaw bahala... sana online aq pag pina-ayus mo... willing naman ako tumulong...
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);
}
}
nagawa ko na po coding nya at tama po ang problema ko nalang po ay yung flowchart di ko kasi magets
 
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=" Ad∩lt";
}
JOptionPane.showMessageDialog(null,"Gender:"+gender+"\nStatus:"+status+"\nAge Bracket:"+age);
}
}
nagawa ko na po coding nya at tama po ang problema ko nalang po ay yung flowchart di ko kasi magets
May napansin ako...dun sa code na "if(canuel... )"Parang baliktad dun sa gender...

Tungkol naman sa flowchart... Kaya mo iyon...walang maling flowchart as long na maeexpress mo dun iung process ng gawa mo... Nagawa mo nga iung code eh... Kaya mu iyon... Tiwala lang... Ipost mo iung gawa mo...tignan ko din...
 
May napansin ako...dun sa code na "if(canuel... )"Parang baliktad dun sa gender...

Tungkol naman sa flowchart... Kaya mo iyon...walang maling flowchart as long na maeexpress mo dun iung process ng gawa mo... Nagawa mo nga iung code eh... Kaya mu iyon... Tiwala lang... Ipost mo iung gawa mo...tignan ko din...
oonga hahaha. di ko napansin
 
Status
Not open for further replies.

About this Thread

  • 6
    Replies
  • 724
    Views
  • 2
    Participants
Last reply from:
euls020

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