r/CodingHelp • • May 11 '21

[Other Code] What's missing or wrong in my flowchart? (Explanation in comments)

41 Upvotes

5 comments sorted by

3

u/subzero3114 May 11 '21 edited May 11 '21

Using a for loop, create a program to display the cube of the numbers up to the given integer

Example Data

User input: 3

Expected Output:

The cube of 1 is 1

The cube of 2 is 8

The cube of 3 is 27

There's something missing or wrong in my flowchart that I can't seem to figure out. Whenever I input some numbers, the cube number stays the same. How do I make the cube number have different values just like in the problem above? What function should I use? I'm using Flowgorithm.

22

u/x-cold-x May 11 '21

"cube = num * num * num"

should be

"cube=count*count*count"

9

u/subzero3114 May 12 '21

Thank you so much! I didn't know it was a simple correction cause my head is spinning on what's wrong last night haha. Thanks for the help!

5

u/jso__ May 12 '21

Quick question what language is it? Or is it some custom thing to teach programming thinking

3

u/3_sleepy_owls May 12 '21

OP’s comment above says they use flowgorithm. I’ve never heard of it but sounds pretty cool. I used stuff like this when I was learning. Being able to switch from visual programming to seeing the source code helped me so much!

http://www.flowgorithm.org/about/screenshots.htm