🔒 Closed JavaExercise2E

Status
Not open for further replies.
IMG_20201025_003126.webp

Using the flowchart above, ano magiging possible Java code answer niyo dito?
(Note: Using if statement only)

Sabi ni prof, marami daw pwedeng maging sagot but different approach. BTW, naipasa ko na kay prof yung code ko for this. :)
 
If yung ininput mong number ay less than or equal (<=) to 3 then yung output is "Mr. X"
If yung ininput mo naman na number ay less than or equal (<=) to 7 then yung output is "Mr. Y"
and kung ininput mo naman na number ay not less than or eqal to 3 and not less than or equal to 7 then yung output is "Mr. Z"
So depende sa ininput na number yung sagot.
 
If yung ininput mong number ay less than or equal (<=) to 3 then yung output is "Mr. X"
If yung ininput mo naman na number ay less than or equal (<=) to 7 then yung output is "Mr. Y"
and kung ininput mo naman na number ay not less than or eqal to 3 and not less than or equal to 7 then yung output is "Mr. Z"
So depende sa ininput na number yung sagot.
Yes po, pero ano po yung magiging code dito using the flowchart given above and by using if statement only. Thanks :)
 
yung condition na dept > 7 ay para ma satisfy yung " No " sa last part.
Ito yung sa flowchart na kapag hindi less than or equal to 7 kailgn ma print si Mr Z.
 
sensya ka na paps di ko nabasa ung note mo, eto namang si loko na nagcomment kahit di pa sigurado sa sagot haha kala ko nasa looping na kayo.hindi rin naman ako sure sa sagot ko dun. kung nasa conditions and if statements na kayo magdedepende lang yan sa input mo regarding sa mga condition, if nameet niya yung certain condition yun iaoutput niya. sa flowchart naman na to sa tingin ko pag kukunin niya yung value ni dept which is 0 ang output ay Mr. X.
 
sensya ka na paps di ko nabasa ung note mo, eto namang si loko na nagcomment kahit di pa sigurado sa sagot haha kala ko nasa looping na kayo.hindi rin naman ako sure sa sagot ko dun. kung nasa conditions and if statements na kayo magdedepende lang yan sa input mo regarding sa mga condition, if nameet niya yung certain condition yun iaoutput niya. sa flowchart naman na to sa tingin ko pag kukunin niya yung value ni dept which is 0 ang output ay Mr. X.
no problem, hahaha..actually fundamentals pa lang kami sa programming. Ayun, sa ngayon kaya pa naman ng utak ko, and yes nasa "IF" only statements pa lang kami wala pa sa "IF..ELSE.." and so on.. :)
 
Status
Not open for further replies.

About this Thread

  • 33
    Replies
  • 722
    Views
  • 8
    Participants
Last reply from:
PHC-aiilabbbyuu

Trending Topics

Online now

Members online
1,030
Guests online
1,335
Total visitors
2,365

Forum statistics

Threads
2,273,331
Posts
28,948,838
Members
1,235,705
Latest member
dkamote13
Back
Top