Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- <html>
- <body>
- <script>
- //question 1
- /*propertyValueAt();
- function propertyValueAt(){
- var i =0;
- var propertyName = prompt("please enter the property name \n");
- var a = prompt("please enter the value for a \n");
- var b = prompt("please enter the value for b \n");
- var c = prompt("please enter the value for c \n");
- var d = prompt("please enter the value for d \n");
- var q = prompt("please enter the value for q \n");
- var info=[a,b,c,d,q]
- if(a==null){
- document.write("I am sorry property name has come back undefined \n");
- }
- if(a==null){
- document.write("I am sorry a has come back undefined \n");
- }
- if(b==null){
- document.write("I am sorry a has come back undefined \n");
- return 0;
- }
- if(c==null){
- document.write("I am sorry b has come back undefined \n");
- return 0;
- }
- if(d==null){
- document.write("I am sorry d has come back undefined \n");
- return 0;
- }
- if(q==null){
- document.write("I am sorry q has come back undefined \n");
- return 0;
- }
- else{
- for(i=0;i<5;i++){
- document.write(info[i]);
- document.write("\n");}
- return 1;
- }
- }*/
- //question 2
- /*sumNested();
- function sumNested(){
- var total=0;
- var array=[];
- var size = prompt("please enter tell me how many numbers we are adding");
- for(i=0;i<size;i++){
- array[i]=parseInt(prompt("please enter the number to be put in the array space "));
- var total= total+ array[i];}
- document.write(total);
- }*/
- wordCount();
- wordCount(){
- }
- <\/script>
- </body>
- </html>
- </script>
- <script id="jsbin-source-javascript" type="text/javascript"><html>
- <body>
- <script>
- //question 1
- /*propertyValueAt();
- function propertyValueAt(){
- var i =0;
- var propertyName = prompt("please enter the property name \n");
- var a = prompt("please enter the value for a \n");
- var b = prompt("please enter the value for b \n");
- var c = prompt("please enter the value for c \n");
- var d = prompt("please enter the value for d \n");
- var q = prompt("please enter the value for q \n");
- var info=[a,b,c,d,q]
- if(a==null){
- document.write("I am sorry property name has come back undefined \n");
- }
- if(a==null){
- document.write("I am sorry a has come back undefined \n");
- }
- if(b==null){
- document.write("I am sorry a has come back undefined \n");
- return 0;
- }
- if(c==null){
- document.write("I am sorry b has come back undefined \n");
- return 0;
- }
- if(d==null){
- document.write("I am sorry d has come back undefined \n");
- return 0;
- }
- if(q==null){
- document.write("I am sorry q has come back undefined \n");
- return 0;
- }
- else{
- for(i=0;i<5;i++){
- document.write(info[i]);
- document.write("\n");}
- return 1;
- }
- }*/
- //question 2
- /*sumNested();
- function sumNested(){
- var total=0;
- var array=[];
- var size = prompt("please enter tell me how many numbers we are adding");
- for(i=0;i<size;i++){
- array[i]=parseInt(prompt("please enter the number to be put in the array space "));
- var total= total+ array[i];}
- document.write(total);
- }*/
- wordCount();
- wordCount(){
- }
- <\/script>
- </body>
- </html></script></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement