Please Scroll Down to See Forums Below
napsgear
genezapharmateuticals
domestic-supply
puritysourcelabs
UGL OZ
UGFREAK
napsgeargenezapharmateuticals domestic-supplypuritysourcelabsUGL OZUGFREAK

Any programmers out there?

oubeta

Well-known member
I'm taking a C programming class and need a little help writing pseudocode.
Here is our first assigment. I don't know where to start. I know that volume of a cylinder is V=pie r squared x height.


Design a program that accepts 2 numerical input values from the keyboard. These values correspond to (1) the radius, and (2) the length of a cylinder. Calculate and display the cylinder’s diameter, area (of the circle), and volume.
Also the program should output, with identification, the values inputted.
Set up a repetition to continue until the user inputs a radius of 0 (zero).

Deliverables: Turn in a hard (printed) copy of your IPO (program analysis) and pseudo-code. You may use the word processor of your choice, e.g., note pad.
I also need a copy of your worksheet where you desk-checked with at least 2 different test cases. This does not need to be typed, but it should be neat and readable.
 
Hey Happy, you should write a bit of code for him that threads on an NN cluster!

I would, but last time I spent time writing code for the board the guy didn't even bother to say thanks.
 
un,a, me no know psuedocode...

try this

input r
input h
do while h<>0 and r<>0
print (2*pie*r)
print (pie*r^2)
print (pie*r^2*h)
input r
input h
loop
 
It's actual programming just pseudocode. I I understand right its pretty simple. Just having problems on where to start. Thanks for the help so far..
Karma for all who helps!
 
I think it's like

DOWHILE condition

''''''''''''''''''''

''''''''''''''''''''

ENDDO

Repeat


until condition

I think you write in in plain englis instead of code,,right?
 
oubeta said:
I think it's like

DOWHILE condition

''''''''''''''''''''

''''''''''''''''''''

ENDDO

Repeat


until condition

I think you write in in plain englis instead of code,,right?

I don't recall ever using anything called pseudocode in college.
I remember design phases where we outlined the proposed code.
 
Code said:


I don't recall ever using anything called pseudocode in college.
I remember design phases where we outlined the proposed code.

I think you're kinda talking about the same thing.

I had to write pseudocode for several classes, and I hated it. It was a combination of an algorithm and actual code. I much preferred sitting down at a computer and working it out on there.
 
I would much rather just jump right into the coding.

Still kinda stuck on where to start.
 
Hmm, if it's just plain english, then take the assignment and copy/paste it into note pad.

Just kidding.

Is the class bascially designed to get you used to breaking actions into objects and functions??

If so, just declare the algorithm to be VolFUNC.

Then declare each variable to be an Object, RAD and DIAM.

Then lay it out as a statement.
 
Code, I've done VB and JAVA in school and we were taught to do pseudo-code before we could actually start to program. Hell, if we didn't turn in the pseudo-code along with the assignments, they would deduct major points for that. I assume they were trying to teach us to think it out on a piece of paper before sitting down in front of a computer.

My opinion? It's great if you have O.C.D. like HappyScrappy.
 
that is exactly what they are tyring to do. I can code better that if i just do it and test it, rather that do this shit.
 
It's harder to write pseudocode for programs as they get smaller. The problem statement pretty much breaks everything down to almost as simple terms as possible.

Also the program should output, with identification, the values inputted.
Set up a repetition to continue until the user inputs a radius of 0 (zero).

My best "guess" would be:


---------------------------------

Code:
while (true)
{
     get radius
     if radius == 0 { break; }
     get length

      diameter = 2 x radius
      volume = radius x radius x pi x length

      print diameter
      print volume
}

----------------------------------

I think my Advanced Windows Programming final assignment was easier than this.

-Warik
 
LOL....Small world. I'm a student at OU taking that same class. You have Jack Warner as your professor? If so, what time is your class? I haven't read the assignment yet cause I was out of town this weekend, but it doesn't seems to be very hard. Just follow the examples in the Lesson 2 powerpoint slides that are available through classfiles.
 
That is crazy. Tues thurs at noon..
I think I got it figured out.

when is your class?
 
Last edited:
Millie said:
have you designed the flow chart already? if not, this is where you might want to start

A flow chart for a 10 line program? What kind of bullshit are universities teaching now?

-Warik
 
We did a lot of flowcharting and code/project planning.

But most of those were for projects that needed special libraries or custom functions.

I can't fathom the pain of breaking a 10 line script into a project and flowchart.

But I know many people who can and DO just that.
 
I got most of it done. Kinda hard to make a flowchart and pseudocode out of a 10 line program. Lot's of good lifting time wasted.
 
Top Bottom