Skip to main content
Participant
March 14, 2021
Question

while Loops

  • March 14, 2021
  • 3 replies
  • 1178 views

Hello, I am very new to JavaScript. 

 

I am wondering if anyone can help me wrap my head around while Loops?? 

As an exercise I was reading about, it says: 

 

A penny the 1st day, double the second day, until you reach $1,000,000. How many days will you work of course I know the math for this. But it states I have to do this as a while Loop and then print it to the document.

 

How should I go about this? 

 

is there a template I can use that would help me for this and similar problems? 

 

Thanks and I hope to hear from someone soon!

This topic has been closed for replies.

3 replies

B i r n o u
Legend
March 15, 2021

Without wanting to create clans within this discussion, I agree with Ben and Nancy's point of view.
It is by forging that one becomes a blacksmith... or it is by learning to sin that one will avoid assisting by giving fish. and so on...
So to the list of valuable advice provided by Nancy, I would add one that seems to me to be the key to many algorithmic approaches and this source of inspiration, although it must be adapted to each reflection, is quite interesting
https://github.com/TheAlgorithms/Javascript

 

Nancy OShea
Community Expert
Community Expert
March 14, 2021

I'm afraid this isn't a Dreamweaver question as much as it's a coding question.  I'm with Ben, I don't do homework.  You'll learn more from exercising YOUR brain cells, not mine 🙂

 

Start here:

 

Nancy O'Shea— Product User & Community Expert
Legend
March 14, 2021

I'm with Ben, I don't do homework. You'll learn more from exercising YOUR brain cells, not mine

 

Funny - Ben uses a mostly automated program/extensions and you both use frameworks, not exactly using your own skills and abilities is it?

Nancy OShea
Community Expert
Community Expert
March 15, 2021

I have an automatic washing machine, too. So what?   You want me to drag laundry to the river bed and pound it with rocks because that's better than a machine?  Uh, I don't think so.

 

Work smarter, not harder 😉

 

 

Nancy O'Shea— Product User & Community Expert
Hawk_1Author
Participant
March 14, 2021

I also want to keep track of how many days I have worked, the current salary as it goes up, and the total amount of money earned. 

BenPleysier
Community Expert
Community Expert
March 14, 2021

This sounds like a homework assignment. Being  grumpy old man, I say to you 'Do your homework'. There are plenty of pointers on the web, just Bingle them.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!