Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

[HELP C# WINFORMS] if else statement

Status
Not open for further replies.

mahal022

The Devotee
Advanced Member
Messages
388
Reaction score
0
Points
26
guys patulong nga sa logic ng late gusto ko sana mang yare ma late sya ng 8, 11, 2, 5
tapos dpat makapag no sya sa 9 - 10 , 12 - 1, 3 - 4

Code:
 int time = 0;

            time = int.Parse(DateTime.Now.Hour.ToString());

            if (time >= 8)
            {
                MessageBox.Show("LATE");
            }
            else
            {
                MessageBox.Show("NO !!"); 
            }

:slap:
 
Last edited:
guys patulong nga sa logic ng late gusto ko sana mang yare ma late sya ng 8, 11, 2, 5
tapos dpat makapag no sya sa 9 - 10 , 12 - 1, 3 - 4

Code:
 int time = 0;

            time = int.Parse(DateTime.Now.Hour.ToString());

            if (time >= 8)
            {
                MessageBox.Show("LATE");
            }
            else
            {
                MessageBox.Show("NO !!"); 
            }

:slap:


Gumamit ka ng multiple if statement. Common sense na lang sana idol pag dating sa programming.

Math logic ginamit mo hindi time logic.

Mga list ng greater than 8 and equal sa 8. yan ang if statement mo. (True lahat ng result jan)

8, 9, 10, 11, 12

Base sa variable type mo is naka INT. Pano yung 1pm - 11pm. Diba?

Dapat naka 24 hours time format ka. Hindi int.

if time type ang variable mo, 24 hours time format

if (09:00.00 >= 08:00:00) = TRUE

if (13:00:00 >= 08:00:00) = TRUE

Gets mo na?

Na explain ko na to dati sa thread mo last time. Still, problema mo pa rin.
 
Gumamit ka ng multiple if statement. Common sense na lang sana idol pag dating sa programming.

Math logic ginamit mo hindi time logic.

Mga list ng greater than 8 and equal sa 8. yan ang if statement mo. (True lahat ng result jan)

8, 9, 10, 11, 12

Base sa variable type mo is naka INT. Pano yung 1pm - 11pm. Diba?

Dapat naka 24 hours time format ka. Hindi int.

if time type ang variable mo, 24 hours time format

if (09:00.00 >= 08:00:00) = TRUE

if (13:00:00 >= 08:00:00) = TRUE

Gets mo na?

Na explain ko na to dati sa thread mo last time. Still, problema mo pa rin.

di ko po alam pano gawin format time yung sa if . newbie lang po kc
 
di ko po alam pano gawin format time yung sa if . newbie lang po kc

Search mo sa google. If gusto mo matutu talaga mag program, wag ka mag papa feed ng code. Discover it by your self.

Wag ka matakot mag experimento sa code, hindi ka makakabuntis sa pag cocode mo.
 
Gumamit ka ng multiple if statement. Common sense na lang sana idol pag dating sa programming.

Math logic ginamit mo hindi time logic.

Mga list ng greater than 8 and equal sa 8. yan ang if statement mo. (True lahat ng result jan)

8, 9, 10, 11, 12

Base sa variable type mo is naka INT. Pano yung 1pm - 11pm. Diba?

Dapat naka 24 hours time format ka. Hindi int.

if time type ang variable mo, 24 hours time format

if (09:00.00 >= 08:00:00) = TRUE

if (13:00:00 >= 08:00:00) = TRUE

Gets mo na?

Na explain ko na to dati sa thread mo last time. Still, problema mo pa rin.

yap tama to haha dapat nag date and time picker ka nalang
 
nagpapaturo si ts about logic..
dapat explain nyo rin logic bakit ganito tips nyo.. advance na kasi kayo..
if (09:00.00 >= 08:00:00) = TRUE

agree ako .. true lahat yan..

old style ng if else.. 24 hrs ..

if time >= 8 and <9
do this.. late
else time >= 11 and < 12
do this late

else time >= 14 and < 15 (between 2 pm to 3 pm)
do this.. late

and so on..
otherwise
do this .. no
... translate nyo nalang sa c# coding.

it means may bounderies din dapat mga if else mo para ma satisfy yung conditions.. do this.. or mag messagebox ka youre late ..

pag greater than >= lang condition with out bounderies. lahat magiging lale.. lagyan mo ng bounderies mga if else mo.. like < less than or with = equal to ..
 
Last edited:
nagpapaturo si ts about logic..
dapat explain nyo rin logic bakit ganito tips nyo.. advance na kasi kayo..
if (09:00.00 >= 08:00:00) = TRUE

agree ako .. true lahat yan..

old style ng if else.. 24 hrs ..

if time >= 8 and <9
do this.. late
else time >= 11 and < 12
do this late

else time >= 14 and < 15 (between 2 pm to 3 pm)
do this.. late

and so on..
otherwise
do this .. no
... translate nyo nalang sa c# coding.

it means may bounderies din dapat mga if else mo para ma satisfy yung conditions.. do this.. or mag messagebox ka youre late ..

pag greater than >= lang condition with out bounderies. lahat magiging lale.. lagyan mo ng bounderies mga if else mo.. like < less than or with = equal to ..

Hindi logic ang tinuro mo. nag feed ka ng code.
 
hindi code yan ng c#.. its just a basic formulation of if else. kaya nga you need to translate if to c sharp.. nways. i guess dapat ts should learn the basic of programming. if else , for each.. while.. etc..
 
hindi code yan ng c#.. its just a basic formulation of if else. kaya nga you need to translate if to c sharp.. nways. i guess dapat ts should learn the basic of programming. if else , for each.. while.. etc..

hindi ko sinabi ng code ng c# yan. lol haha peace.

Agree ako sayo na dapat alam nila ang basic.
 
nagpapaturo si ts about logic..
dapat explain nyo rin logic bakit ganito tips nyo.. advance na kasi kayo..
if (09:00.00 >= 08:00:00) = TRUE

agree ako .. true lahat yan..

old style ng if else.. 24 hrs ..

if time >= 8 and <9
do this.. late
else time >= 11 and < 12
do this late

else time >= 14 and < 15 (between 2 pm to 3 pm)
do this.. late

and so on..
otherwise
do this .. no
... translate nyo nalang sa c# coding.

it means may bounderies din dapat mga if else mo para ma satisfy yung conditions.. do this.. or mag messagebox ka youre late ..

pag greater than >= lang condition with out bounderies. lahat magiging lale.. lagyan mo ng bounderies mga if else mo.. like < less than or with = equal to ..

salamat po sir. mejo napa isip po kc ako sa syntax nato if (09:00.00 >= 08:00:00) = TRUE kaya naguluhan ako buti nlng po na explain nyo yung code ko. maraming salamat po sana marami tao katulad nyo :salute::salute:
 
Last edited:
Keep practicing, wag ka matakot mag kamali. Hindi ka makakabuntis sa pag eexperimento sa pag code. The more error you encounter, the more you learn. Okay? Good luck.

Feel free to pm me for more info.
 
hindi ko sinabi ng code ng c# yan. lol haha peace.

Agree ako sayo na dapat alam nila ang basic.
no worries. tulung lang tayo sa mga newbies programmer/sa. dapat din wag spoon feed. kaya basic lang muna post ko. peace.
 
Status
Not open for further replies.
Back
Top Bottom