How to make a simple program that shows like your name | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 7

How to make a simple program that shows like your name

Since Olin Guerrero came with the idea to make like a program that like does this Input : Example and 28 The name of him is ...( example ) and hes ... (28) years old Thank you all!

13th Jun 2019, 7:25 PM
mine
mine - avatar
13 Réponses
+ 8
Like in what programming language? Like where's your attempt? https://www.sololearn.com/discuss/1316935/?ref=app
13th Jun 2019, 7:42 PM
Anna
Anna - avatar
+ 6
Hey mine, here's the code for you: https://code.sololearn.com/WPLKBFMK1sBP/?ref=app You'll notice in the code how I've NOT used any fancy trick for string concatenation. It's just that simple. Also, I've used labels with inputs in the form since the label tag is specifically used to put labels on input boxes. I hope this helps. Edit: Please don't ask these twice. You could have continued the discussion in this thread. https://www.sololearn.com/Discuss/1844341/?ref=app
15th Jun 2019, 2:54 PM
Kainatic [Mostly Inactive Now]
Kainatic [Mostly Inactive Now] - avatar
+ 5
Anna Here is my try, https://code.sololearn.com/WI9jRDp98i7w/?ref=app i dont know how to get the info to the text though.. If someone could help me with that.. that would be amazing! and yes, i searched on google but only found things about get and post things wich i think isnt really usefull in this..
13th Jun 2019, 7:56 PM
mine
mine - avatar
+ 5
I think your input is correct. But you need an output. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output
13th Jun 2019, 9:32 PM
Denise Roßberg
Denise Roßberg - avatar
14th Jun 2019, 3:42 AM
Sonic
Sonic - avatar
+ 4
do you know how to get input?
13th Jun 2019, 8:34 PM
Cat Sauce
Cat Sauce - avatar
+ 3
Olin Guerrero sadly, nope..
13th Jun 2019, 8:38 PM
mine
mine - avatar
+ 3
Jonas thank you alot! i got alot further now! buttt im now trying to get the hello, and the name on the same line with what i made.. ( https://code.sololearn.com/WuMfDcxI0736/?ref=app ) I tried putting both the ids in the same <p> but that didnt work.. also read about <span> wich also didnt work, If anyone could help me with that, then i think i almost completed my first project in html! ( also going to add the age thing but that will be easy. )
14th Jun 2019, 2:21 PM
mine
mine - avatar
14th Jun 2019, 12:10 AM
Jonas
Jonas - avatar
+ 2
Well, thank you all.. But im still stuck, i tried to use output but couldnt find it to work.. i tried to find something on youtube and stuff and did it like this.. https://code.sololearn.com/WxTN9kiO1v0w But it still doenst work and i dont know why. If anyone could help me that would be great!
14th Jun 2019, 10:23 AM
mine
mine - avatar
+ 2
The code had some syntax errors. I've fixed the code and put a comment to highlight the errors. Syntax errors are common mistakes for everyone including advance programmers. It is easy to miss a semicolon or mixing up zeros with a letter "o" and stuff like that. We just need to put more attention when typing. https://code.sololearn.com/W0vKo7cU0BjY/?ref=app
14th Jun 2019, 11:26 AM
Jonas
Jonas - avatar
+ 2
I think the trick is inside the function, just concatenate the string in the same manner of the first code you posted. Just build the string something like: ...("Hello" + Name + LastName); I really don't now JavaScript (yet) but is all about a programming mindset. Make sure you know the foundations on programming like data types, functions, variables, algorithm design and all that stuff. I think you have more knowledge in JavaScript than me but probably your foundations in programming can be improved.
15th Jun 2019, 12:13 AM
Jonas
Jonas - avatar
+ 2
thanks all for your help!
15th Jun 2019, 10:12 PM
mine
mine - avatar