Challenge For Javascript Beginners/intermidiate - Programming (2) - Nairaland
Nairaland Forum › Science/Technology › Programming › Challenge For Javascript Beginners/intermidiate (5094 Views)
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 8:19pm On Sep 22, 2017 |
Very easy...i came up with that stuff when my console.log always return "undefined" along with my output...so I thought of a way to eliminate d "undefined" |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 8:22pm On Sep 22, 2017 |
nsimageorge:Try it out |
| Re: Challenge For Javascript Beginners/intermidiate by nsimageorge(m): 8:38pm On Sep 22, 2017 |
Jaddo19:It didn't work. Except you are testing your code in a non-popular environment. To the best of my knowledge, the javascript console can be accessed only through the console object. |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 8:39pm On Sep 22, 2017 |
I tried it with typeof,object,array...and it worked |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 8:40pm On Sep 22, 2017 |
write a program that'Ll prompt user to enter 0 to conver from usd to rmb. And 1 to convert from rmb to usd Like this Enter exchange rate from $ to rmb-6.81 Enter 0 to convert usd-rmb and 1 vice versa Enter dollar amount-$100 $100 is 681.0yuan Enter the exchange rate from $-rmb-Enter 0 to convert usd-rmb and 1 vice versa Enter the rmb amount-10000 10000yuan is $1468.43 |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 8:43pm On Sep 22, 2017 |
nsimageorge:I can send u a screenshot if u want...it worked on node.js and my browser console |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:02pm On Sep 22, 2017 |
Jaddo19:Its going to work but The return keyword is Different to the console.log It both prints outs a message But the return bring back a value while console.log print out but is actually undefined |
| Re: Challenge For Javascript Beginners/intermidiate by vaspire: 9:28pm On Sep 22, 2017 |
Jaddo19:function checkVariableUndefined(){ If (Variable===undefined){ console.log ('Variable Undefined') }else{ console.log('Variable defined') } } checkVariableUndefined() ...still a beginner, help your girl rate her code mbok... |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 9:32pm On Sep 22, 2017 |
vaspire:Nice one..... |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:34pm On Sep 22, 2017 |
vaspire:Your function doesn't have a argument, checkVariableUndefined(argument) |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 10:08pm On Sep 22, 2017 |
bjhaid: |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 10:13pm On Sep 22, 2017 |
bjhaid:This yha challenge dey fear person ooo....but I would try to do something about it.....pls explain better to avoid stories that touch |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 10:57pm On Sep 22, 2017 |
Jaddo19:try with prompts and conditionals |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 3:43pm On Sep 23, 2017 |
bjhaid:Pls explain this ur challenge well.....i have solved the prompt part of it so explain that conversion aspect well |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 6:53am On Sep 24, 2017 |
bjhaid:I got a solution to your challenge on paper all that's left is testing it.....my solution converts from dollar to naira and vice versa hope u don't mind |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 12:13pm On Sep 24, 2017 |
Jaddo19:don't mind, let's see the solution |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:46pm On Sep 24, 2017 |
bjhaid:var stringAnswer = prompt("Enter 0 to Convert From USD to RMB,And 1 to Convert From RMB to USD And Quit To Exit The App" ![]() var numberString = Number(stringAnswer) while(stringAnswer !== "quit" {if(numberString === 0){ var stringAmount = prompt("How Much USD Do you Want to Convert to RMB" ;var amount = Number(stringAmount); rmb(amount); } else if(numberString === 1){ var stringAmount1 = prompt("How Much RMB Do You Want To Convert To USD" ;var amount1 = Number(stringAmount1); usd(amount1); } stringAnswer = prompt("Enter 0 to Convert From USD to RMB,And 1 to Convert From RMB to USD And Quit To Exit The App" ![]() numberString = Number(stringAnswer) } alert("You Have Quit The App" ;function rmb(money){ var result = money * 6.81 alert(result + " USD" ;return result } function usd(money){ var result1 = money / 6.81 alert(result1 + " RMB" ;return result1 } |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:47pm On Sep 24, 2017 |
I Optimized It Abit i just tried it and it works |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 9:51pm On Sep 24, 2017 |
modash:okay, little diff from mine, will post tomorrow |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:54pm On Sep 24, 2017 |
bjhaid:cool, will see your tomorrow then any other challenges |
| Re: Challenge For Javascript Beginners/intermidiate by Nobody: 9:58pm On Sep 24, 2017 |
modash:write a program that prints Foo Bar Fooz Repeatedly ten times |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 11:58pm On Sep 24, 2017 |
bjhaid:for(var i = 0; i < 10; i++){ console.log("Foo" ![]() console.log("Bar" ![]() console.log("Fooz" ![]() } |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 7:17am On Sep 25, 2017 |
var prom=prompt('enter 0 to convert from dollar to naira and 1 to convert from naira to dollor'); |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 7:21am On Sep 25, 2017*. Modified: 8:23pm On Sep 29, 2017 |
just incase i am not here to reply those that would say d code did not work......i tested and retested d code and its working fine |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 7:25am On Sep 25, 2017 |
i misplaced my phone so i wouldnt be here for a while...i had to borrow someones phone so i could paste my solution........ like i always say everyone is welcome to post a challenge so d thread wouldnt die for beginners sake....God bless u all |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 9:07am On Sep 25, 2017 |
modash:i dunno why the wink emoji keeps appearing on nairaland |
| Re: Challenge For Javascript Beginners/intermidiate by Jaddo19(op): 10:21am On Sep 25, 2017 |
modash:Next time wrap ur code in a quote tag.....its better than nairaland code tag......it should eliminate d emoji |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 10:26am On Sep 25, 2017 |
Jaddo19:Thanks |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 2:29pm On Sep 25, 2017 |
I have an interesting challenge, write a program that gives you factorial of a number E.g 5! = 5*4*3*2*1 = 120 4! = 4*3*2*1 = 24 3! = 3*2*1 = 6 2! = 2*1 = 2 1! = 1*1 = 1 0! = 1 (note the answer for zero factorial) |
| Re: Challenge For Javascript Beginners/intermidiate by Silverman42(m): 12:07am On Sep 26, 2017 |
function factorial(num) { |
| Re: Challenge For Javascript Beginners/intermidiate by modash(m): 6:26pm On Sep 27, 2017 |
Àny other trys |
| Re: Challenge For Javascript Beginners/intermidiate by myrum(m): 1:05am On Sep 28, 2017 |
please is there any .Net programmer whom I can work with as an intern in the house I just rounded up my training on Asp. Net MVC would really appreciate 08118559693 from Lagos |
Introduction To Airtable For Javascript Developers • Whatsapp Group For Javascript Developers • Learn And Get The Source Code For Javascript Type Writer Code • 2 • 3 • 4
Business Objects Connectivity To Oracle Rdb Database Issue • Can You Solve This Google Coding Interview Problem? (pics) • Algorithm Workout!
