Help: Any computer programmers on here?

Josh2002cc

That Uncle
Apr 2, 2007
1,832
0
0
39
I recently enrolled in a intro to computer programming class and I seem to need help with even the basics of the basic when it comes to programming. I have an assignment that wants me to write psuedocode for a simple math equation, specfically body mass index.

Can someone give me a hand with this? I have attached the actual assignment for review. I would appreciate any help on how to get started with this.

For the record; I am not trying to get someone to do my homework for me, I would like to understand this stuff. As you can imagine, the instructor is dry and laughs at his own programming jokes that I don't even understand. :rofl: So yeah....
 

Attachments

  • Assignment 2.doc
    26 KB · Views: 16
  • Exercise 2.doc
    22.5 KB · Views: 13

Josh2002cc

That Uncle
Apr 2, 2007
1,832
0
0
39
What language are you having to use? fortran, basic, C+, etc


Corey

Corey,

I don't think we have reached that part of class yet because....I have no idea what you are asking. :confused:

As I research this pseudo code more, I see that they are asking for very basic terms that will eventually make-up the programming or atleast guide me to the program. I will attach what I have so far based off the book and examples provided.
 

Attachments

  • Hierarchy Chart.jpg
    Hierarchy Chart.jpg
    140.8 KB · Views: 21
  • Psuedo Code.jpg
    Psuedo Code.jpg
    179.7 KB · Views: 18

SBLC

Here to Learn
Jun 12, 2008
98
0
6
Utah
When you say Pseudocode, I think of an outline that gives you path to follow that will help solve your problem. From what you posted I think you have a good start; it depends on how in depth is the instructor looking for. I think of Pseudocode as a "fake" code (i.e. the Pseudo part) which will help you in writing your code. See the attached pdf as this was a "Pseudocode" I had from the start of my BSME. This was going to be coded in Fortran. I typed from memory real quick regarding the questions you posted so they could be wrong, and I didnt proofread my responses so forgive the hard read.

C++, Fortran, Matlab, Python, Excel VBA, JAVA.... are just languages that require their own specific syntax.
 

Attachments

  • Pseudocode_001.pdf
    522.4 KB · Views: 4
  • Exercise 2-1_001.pdf
    537 KB · Views: 3
Last edited:

SBLC

Here to Learn
Jun 12, 2008
98
0
6
Utah
They still use Fortran? Ho-lee shit, I studied that back in 1983. :eek:

I had to learn Fortran to graduate, but towards the end as long as you knew Fortran they allowed us to program in whatever we wanted. I turned to Matlab alot during my composites course; however, I can see using Fortran for CFD/heavy computational codes.
 
Dec 2, 2006
1,696
0
36
TN
Code:
Pseudocode:

BEGIN PROGRAM

READ INPUT FOR weight, height  FROM USER

var1 holds the value of weight * 703

var2 holds the value of height * height 

bmi holds the value of var1 divided by var2

END



For the Pseudocode it just depends on how much detail they really want. For this problem, it's pretty basic so what I've given is a very high level.

To explain..

READ is gathering the data from the user. After you get the input of weight and height, the values are assigned into the respective variables and stored.

var1 is a "holder" for the calculation of weight multiplied by 703. var2 is a calculation of height squared (or height * height).

bmi is the Body Mass index number as var1 is divided by var2.

The flow chart would be just an outline how the user flows through the program. Get the input, show inputs needed, show calculations by step and order, etc..


Modules (or functions) help you in a number of ways. The biggest is the reuse of code. Not only does that keep the code cleaner but it also saves a lot of time by not having to rewrite code if you later need it in the program. And you know if the module works one time, it should be good the next time you call the module again.

For the rest, I could type pages for you but google is your friend for most of those questions. Really study and understand, because moving on things do not get easier.
 

Josh2002cc

That Uncle
Apr 2, 2007
1,832
0
0
39
When you say Pseudocode, I think of an outline that gives you path to follow that will help solve your problem. From what you posted I think you have a good start; it depends on how in depth is the instructor looking for. I think of Pseudocode as a "fake" code (i.e. the Pseudo part) which will help you in writing your code. See the attached pdf as this was a "Pseudocode" I had from the start of my BSME. This was going to be coded in Fortran. I typed from memory real quick regarding the questions you posted so they could be wrong, and I didnt proofread my responses so forgive the hard read.

C++, Fortran, Matlab, Python, Excel VBA, JAVA.... are just languages that require their own specific syntax.

After doing my own research, this is what I came up with as well. Fake code that follows no real rules.

To clarify, in this class we will not be doing any real programming. We are learning the basics.

I tried to open your PDF files however my computer will not open PDF's for some reason. I would like to see what you came up with though so I will work on that.


Code:
Pseudocode:

BEGIN PROGRAM

READ INPUT FOR weight, height  FROM USER

var1 holds the value of weight * 703

var2 holds the value of height * height 

bmi holds the value of var1 divided by var2

END



For the Pseudocode it just depends on how much detail they really want. For this problem, it's pretty basic so what I've given is a very high level.

To explain..

READ is gathering the data from the user. After you get the input of weight and height, the values are assigned into the respective variables and stored.

var1 is a "holder" for the calculation of weight multiplied by 703. var2 is a calculation of height squared (or height * height).

bmi is the Body Mass index number as var1 is divided by var2.

The flow chart would be just an outline how the user flows through the program. Get the input, show inputs needed, show calculations by step and order, etc..


Modules (or functions) help you in a number of ways. The biggest is the reuse of code. Not only does that keep the code cleaner but it also saves a lot of time by not having to rewrite code if you later need it in the program. And you know if the module works one time, it should be good the next time you call the module again.

For the rest, I could type pages for you but google is your friend for most of those questions. Really study and understand, because moving on things do not get easier.

After class today your post made much more sense. We covered basically everything you have explained to me. You did a much better job explaining it than my instructor.

I spoke to him about how I went about doing the pseudo code and he said it was ok but I was missing a sub process or another module. I guess he wanted us to use at least one module. I didn't hear that part and it wasn't in the assignment so...oh well.

In red I highlighted a section where you said it is a higher level than the basic requirements our instructor was looking for. When you say a higher level do you mean more advanced in the sense that you are achieving the same goal using less code? My work is much longer and still wasn't correct so that is where my question comes from.

I would like to thank everyone who has helped me this far, I really do appreciate it. I currently have a 4.0 and would like to keep it that way, especially since I do not "need" this class. I would hate to lower my grade on a subject that is an elective. :(
 

SBLC

Here to Learn
Jun 12, 2008
98
0
6
Utah
Here are the Word docs, take them with a grain of salt.

What I gather from 8100 Power's comment that you highlighted red is he has given you a very generic overview. He has defined his variables var1 and var2 and does one calculation to obtain the bmi variable, but he doesn't define every logical/syntax steps of the code. 8100 Power, Correct me if I am wrong
 

Attachments

  • Pseudocode_R3.doc
    28 KB · Views: 2
  • Exercise 2-1_Josh2002_Coding_R3.doc
    27.5 KB · Views: 1
Last edited: