Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Stuck on a flowchart or pseudocode, can someone help?
New Posts  All Forums:Forum Nav:

Stuck on a flowchart or pseudocode, can someone help?

post #1 of 4
Thread Starter 
hey guys please do not make fun of me, im only a couple days new to C++, however i am picking up real quick. I can code the language as i learn however when it comes to flowcharts or pseudo codes i suck. Can someone help me with my flowchart or pseudo code ?

I'm suppose to write a program that calculates area and circumference of a circle.

Assuming the circle has a radius of 3.3 inches
Circumference = 2* 3.1416* radius
Area= 3.1416* radius*radius

Now I've coded this in like 5 minutes literally, however i do not know how to do the easy part which is making a flowchart for it or pseudo code. can someone help?
overclocking toy
(13 items)
 
  
CPUMotherboardGraphicsRAM
I7-950 Asus P6TD Deluxe MSI GTX 560 TI Corsair XMS3 12gb DDR3 
Hard DriveOptical DriveOSMonitor
1.5 TB @7200 RPM Blu-Ray/DVD/CD + Burner Windows 7 Asus 27" LED 
PowerCase
Corsair HX 850 Coolermaster HAF 932 
  hide details  
Reply
overclocking toy
(13 items)
 
  
CPUMotherboardGraphicsRAM
I7-950 Asus P6TD Deluxe MSI GTX 560 TI Corsair XMS3 12gb DDR3 
Hard DriveOptical DriveOSMonitor
1.5 TB @7200 RPM Blu-Ray/DVD/CD + Burner Windows 7 Asus 27" LED 
PowerCase
Corsair HX 850 Coolermaster HAF 932 
  hide details  
Reply
post #2 of 4
I think that you may misunderstand the purpose of pseudo code and flowcharts. They are generally something you do before actually writing the code (regardless of how trivial the code itself is).

The idea is that you plan out the course of operation for a program and then create it.

So using your example of a program that calculates the area or circumference of a circle, let's try planning out what the program might end up like.

So what is the first thing we want our program to do? We need to the radius to day any of our work, so perhaps our flowchart begins something like...
Code:
                         [start]
                            |
                            |
                      obtain radius
                        from user
                            |
                            |
Then we want to think about the next step the program takes. I'll guess that we want to ask the user if they want to calculate the area or circumference or both right? So perhaps we continue with something like...

Code:
                            |
                            |
           ___________what do we want____________
          |            to calculate              |
          |                 |                    |
          |                 |                    |
        area           circumference            both
          |                 |                    |
Hopefully you can kind of see where this is going. The next steps will probably be to do the calculations etc. The idea here though is that you are creating a road map for your program. And sure, it seems kind of silly for something that seems kind of trivial like calculating the area of a circle, but it can really help when you start working on much larger programs or applications.

Best of luck coding!
Kurogane
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenon XII Callisto 3.1 GHz ASUS M4A785TD-M Evo XFX 5570 Corsair 4GB XMS3 
Hard DriveOptical DriveOSMonitor
1T Western Digital Asus 24x DVD RW+/- OpenBSD 5.0, Archlinux 20" Viewsonic 
KeyboardPowerMouse
MS Ergonomic Corsair 750W Silver Razer Lanchis 
  hide details  
Reply
Kurogane
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenon XII Callisto 3.1 GHz ASUS M4A785TD-M Evo XFX 5570 Corsair 4GB XMS3 
Hard DriveOptical DriveOSMonitor
1T Western Digital Asus 24x DVD RW+/- OpenBSD 5.0, Archlinux 20" Viewsonic 
KeyboardPowerMouse
MS Ergonomic Corsair 750W Silver Razer Lanchis 
  hide details  
Reply
post #3 of 4
Thread Starter 
Quote:
Originally Posted by skylarhawk View Post
I think that you may misunderstand the purpose of pseudo code and flowcharts. They are generally something you do before actually writing the code (regardless of how trivial the code itself is).

The idea is that you plan out the course of operation for a program and then create it.

So using your example of a program that calculates the area or circumference of a circle, let's try planning out what the program might end up like.

So what is the first thing we want our program to do? We need to the radius to day any of our work, so perhaps our flowchart begins something like...
Code:
                         [start]
                            |
                            |
                      obtain radius
                        from user
                            |
                            |
Then we want to think about the next step the program takes. I'll guess that we want to ask the user if they want to calculate the area or circumference or both right? So perhaps we continue with something like...

Code:
                            |
                            |
           ___________what do we want____________
          |            to calculate              |
          |                 |                    |
          |                 |                    |
        area           circumference            both
          |                 |                    |
Hopefully you can kind of see where this is going. The next steps will probably be to do the calculations etc. The idea here though is that you are creating a road map for your program. And sure, it seems kind of silly for something that seems kind of trivial like calculating the area of a circle, but it can really help when you start working on much larger programs or applications.

Best of luck coding!
Thanks for the explanation bud, I catch the drift now...
overclocking toy
(13 items)
 
  
CPUMotherboardGraphicsRAM
I7-950 Asus P6TD Deluxe MSI GTX 560 TI Corsair XMS3 12gb DDR3 
Hard DriveOptical DriveOSMonitor
1.5 TB @7200 RPM Blu-Ray/DVD/CD + Burner Windows 7 Asus 27" LED 
PowerCase
Corsair HX 850 Coolermaster HAF 932 
  hide details  
Reply
overclocking toy
(13 items)
 
  
CPUMotherboardGraphicsRAM
I7-950 Asus P6TD Deluxe MSI GTX 560 TI Corsair XMS3 12gb DDR3 
Hard DriveOptical DriveOSMonitor
1.5 TB @7200 RPM Blu-Ray/DVD/CD + Burner Windows 7 Asus 27" LED 
PowerCase
Corsair HX 850 Coolermaster HAF 932 
  hide details  
Reply
post #4 of 4
Glad I could help
Kurogane
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenon XII Callisto 3.1 GHz ASUS M4A785TD-M Evo XFX 5570 Corsair 4GB XMS3 
Hard DriveOptical DriveOSMonitor
1T Western Digital Asus 24x DVD RW+/- OpenBSD 5.0, Archlinux 20" Viewsonic 
KeyboardPowerMouse
MS Ergonomic Corsair 750W Silver Razer Lanchis 
  hide details  
Reply
Kurogane
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenon XII Callisto 3.1 GHz ASUS M4A785TD-M Evo XFX 5570 Corsair 4GB XMS3 
Hard DriveOptical DriveOSMonitor
1T Western Digital Asus 24x DVD RW+/- OpenBSD 5.0, Archlinux 20" Viewsonic 
KeyboardPowerMouse
MS Ergonomic Corsair 750W Silver Razer Lanchis 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Stuck on a flowchart or pseudocode, can someone help?