","upvoteCount":3},{"@type":"Answer","text":"Sharofiddin why","upvoteCount":3},{"@type":"Answer","text":"Sharofiddin bro I written JavaScript","upvoteCount":3},{"@type":"Answer","text":"Your first if block that checks studentStatus is syntactically wrong. The curly brace should be after the condition.\n\nThe second else if block doesn't have to end to with a semi colon\n\nThe last else block is missing a closing brace.","upvoteCount":3},{"@type":"Answer","text":"var i = InternationalFull-time;\nHere you can't use -minus sign in variables. It's invalid. Learn about variable declarations.\nAnd it still undefined so can't assign it before initialization. First initialize, and assign value then use it. There are more similar errors... \nAnd document.wrire function is not defined properly.. Use braces like \ndocument.write( \"hello\" );","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 its = equal","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 could you give me an example how?","upvoteCount":2},{"@type":"Answer","text":"//Variable Declaration these 3 are invalid \nvar I=internationalFull-time;\nvar F=domesticFull-time;\nvar P=domesticPart-time;\n\nCorrect way :\n\nvar internationalFull_time; //using underscore\nvar domesticFull_time;\nvar domesticPart_time;\n\nNow take values into these variables by prompt..\n( Or directly take while initialization like \nvar InternationalFull_time = prompt(\"Enter\" \"\"); ) \n\nAnd then after assign to I, F, P\nLike\nvar I = internationalFull_time;\nvar F = domesticFull_time;\nvar P = domesticPart_time;","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 ok bro what else is wrong","upvoteCount":2},{"@type":"Answer","text":"Do I have to write both in //variable declaration section?\n\nvar internationalFull_time; \nvar domesticFull_time;\nvar domesticPart_time; Jayakrishna🇮🇳","upvoteCount":2},{"@type":"Answer","text":"I already told it on 1st post all.\ndocument.write \"hello\" like this you wrote but\ndocument.write( \" hello\" ); correct way.\n\nOh. What actually you are trying? Are you trying like\nInternationalFull_time == \"I\"\nThen actually no need to declare I, F, P\nIn if statements use it like \"I\", \"F\",, \"P\" instead I, F, P..\nRemove I, F, P declarations..","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 hi bro I didn't get you could you write and it","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 ok bro is it error free now","upvoteCount":2},{"@type":"Answer","text":"Jayakrishna🇮🇳 I have sent you a message please reply there. I am making another one, could you fix that","upvoteCount":2},{"@type":"Answer","text":"Sahil Chib I dont got any message. May be My DM not work..\nYou can leave..\nor here make question some other can answer. I try to look it after some time brake.","upvoteCount":1},{"@type":"Answer","text":"Jayakrishna🇮🇳 its a question actually we have to make java statement out of question","upvoteCount":1},{"@type":"Answer","text":"Jayakrishna🇮🇳 can I tell you question here","upvoteCount":1}]}
}
+ 6
find error in code
<html>
<head><title>Hello</title></head>
<body>
<script type ="text/javascript">
//Program name :
//Author : Sahil Chib
//Date Created : 10/10/2020
//Variable Declaration
var studentName;
var I=internationalFull-time;
var F=domesticFull-time;
var P=domesticPart-time;
var studentStatus;
var BR=<br/>";
//Gather Input
studentName = prompt("Enter Your Name","");
studentStatus = prompt("What is your status?","");
internationalFull-time = prompt("Enter I for internationalFull-time","");
domesticFull-time= prompt("Enter F for internationalFull-time","");
domesticPart-time= prompt("Enter P for internationalFull-time","");
if{(studentStatus == I) {"document.write "Go to room 227 +BR+ THANK YOU FOR USING THE PROGRAM" };
else if(studentStatus == F) { "document.write "Go to room 123 +BR+ THANK YOU FOR USING THE PROGRAM" };
else(studentStatus == P) { "document.write "Go to room 055 +BR+
- (hyphon)?
In InternationalFull-time;?
You can use underscore like
InternationalFull_time;Sahil Chib
11th Oct 2020, 3:43 PM
Jayakrishna 🇮🇳
+ 3
Jayakrishna🇮🇳 could you tell what to initialize in this code
11th Oct 2020, 3:46 PM
Sahil Chib
+ 3
<html>
<head><title>Hello</title></head>
<body>
<script type ="text/javascript">
//Program name :
//Author : Sahil Chib
//Date Created : 10/10/2020
//Variable Declaration
var internationalFull_time = prompt("Enter I for internationalFull-time","");
var domesticFull_time = prompt("Enter F for internationalFull-time","");
var domesticPart_time = prompt("Enter P for internationalFull-time","");
var studentStatus;
var BR="<br/>";
//Gather Input
var studentName = prompt("Enter Your Name","");
studentStatus = prompt("Enter student status :", "" );
if(studentStatus == "I")
document.write("Go to room 227 "+BR+ "THANK YOU FOR USING THE PROGRAM");
else if(studentStatus == "F") {
document.write("Go to room 123 "+BR+ "THANK YOU FOR USING THE PROGRAM"); }
else if(studentStatus == "P") {
document.write("Go to room 055 "+BR+ "THANK YOU FOR USING THE PROGRAM") } ;
</script>
Your first if block that checks studentStatus is syntactically wrong. The curly brace should be after the condition.
The second else if block doesn't have to end to with a semi colon
The last else block is missing a closing brace.
13th Oct 2020, 4:59 AM
Kirabo Ibrahim
+ 2
var i = InternationalFull-time;
Here you can't use -minus sign in variables. It's invalid. Learn about variable declarations.
And it still undefined so can't assign it before initialization. First initialize, and assign value then use it. There are more similar errors...
And document.wrire function is not defined properly.. Use braces like
document.write( "hello" );
//Variable Declaration these 3 are invalid
var I=internationalFull-time;
var F=domesticFull-time;
var P=domesticPart-time;
Correct way :
var internationalFull_time; //using underscore
var domesticFull_time;
var domesticPart_time;
Now take values into these variables by prompt..
( Or directly take while initialization like
var InternationalFull_time = prompt("Enter" ""); )
And then after assign to I, F, P
Like
var I = internationalFull_time;
var F = domesticFull_time;
var P = domesticPart_time;
Do I have to write both in //variable declaration section?
var internationalFull_time;
var domesticFull_time;
var domesticPart_time; Jayakrishna🇮🇳
11th Oct 2020, 4:02 PM
Sahil Chib
+ 2
I already told it on 1st post all.
document.write "hello" like this you wrote but
document.write( " hello" ); correct way.
Oh. What actually you are trying? Are you trying like
InternationalFull_time == "I"
Then actually no need to declare I, F, P
In if statements use it like "I", "F",, "P" instead I, F, P..
Remove I, F, P declarations..
11th Oct 2020, 4:04 PM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 hi bro I didn't get you could you write and it
Jayakrishna🇮🇳 I have sent you a message please reply there. I am making another one, could you fix that
11th Oct 2020, 4:21 PM
Sahil Chib
+ 1
Sahil Chib I dont got any message. May be My DM not work..
You can leave..
or here make question some other can answer. I try to look it after some time brake.
11th Oct 2020, 4:29 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 its a question actually we have to make java statement out of question