Click here to Skip to main content
15,886,664 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
if (day == "friday")
{
document.write("thank god its friday");
}
else if (day == "Monday")
{
document.write("Blue Monday");
}
else{day == "Monday");
{
document.write("Today is "+day);
}
Posted
Updated 7-Aug-14 4:36am
v2
Comments
hypermellow 7-Aug-14 10:35am    
What have you tried, where are you stuck?
PIEBALDconsult 7-Aug-14 10:37am    
I don't think that will even compile anyway.

You can't - it's rubbish.
Look at the last bit:
C#
else{day == "Monday");
{
document.write("Today is "+day);
}
What is that supposed to mean?
The brackets don't match, else doesn't have a condition, if the condition is intended as a statement it does nothing - but the document.write will always be executed regardless of the code above it.

It won't compile in any language I am aware of, and looks like you have grabbed random bits from the internet and chucked them together without thinking about what you are trying to achieve. If true, that is not a successful design strategy! :laugh:
 
Share this answer
 
I think your question should be
C#
if (day == "friday")
{
    document.write("thank god its friday");
}
else if (day == "Monday")
{
    document.write("Blue Monday");
}
else
{
    document.write("Today is "+day);
}


here is vb code


VB
If day = "friday" Then
    document.write("thank god its friday")
ElseIf day = "Monday" Then
    document.write("Blue Monday")
Else
    document.write("Today is " & day)
End If
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900