Question
All answers are supposed to be in Java script
thanks!
1. Is the following statement legal? Why? 300591 dmun 19trs 192 Slity...ob boshinod ni bo muovin W if (x>0) ibismis boolean p
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1

no this is illegal.

'boolean pos' is not a correct identifer.

2

var age;
       var price;
       if(age>=0&&age<=3){
           price="Free";
       }else if(age>=4&&age<=12){
           price=3.99;
       }else if(age>=13&&age<=65){
           price=9.99;
       }else if(age>65){
           price=5.99;
       }

3

var ch;

       ch=prompt("enter a character");
       var res;
       if(ch=='A'||ch=='a'){
           res="Excellent";
       }else if(ch=='B'||ch=='b'){
           res="Good";
       }else if(ch=='C'||ch=='c'){
           res="Average";
       }else if(ch=='D'||ch=='d'){
           res="Need Improvement";
       }else if(ch=='E'||ch=='e'){
           res="Poor";
       }

4

for(var i=1;i<=1000;i++){
           console.log(3*i);
       }

5

for(var i=1;i<=100;i++){
           console.log(Math.random()*2-1);
       }

6

for(var i=1;i<=100;i++){
           console.log(Math.floor(Math.random()*200)-100);
       }

Add a comment
Know the answer?
Add Answer to:
All answers are supposed to be in Java script thanks! 1. Is the following statement legal?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT