Jump to content

some coding help please? NoOb here

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
GreenNoob

GreenNoob

    Newbie

  • Members
  • Pip
  • 4 posts
Hi Every one!
I am in my programing class right now for about 2 weeks. I have to say im struggling with it. I'm currently working in a homework assigment. I need to write it in a form of a IPO and pseudocode but the fourther i go in to coding i get lost more and more.
This is what i currently have:

Main Module
     Declare Unit_Name as String
     Declare Unit_Price_Per_Pound as Integer
     Declare Unit_Price_Per_Ounce as Integer
     Declare Weight_In_Pound as Integer
     Declare Weight_In_Ounce as Integer
     Declare Total_Weight_In_Pounds as Integer
     Declare Total_Weight_In_Ounces as Integer    
     Declare Total_Unit_Weight as Real
     Declare Display Unit_Name as String
     Declare Display Weight_In _Pound as Integer
     Declare Display Weight_In _Ounce as Integer
     Declare Display Total_Price¬_Per_Pound as Real
     Declare Display Total_Price_Per_Ounce as Real
     Declare Display Total_Price as Real
     Declare Display Message as String
     Call Unit_Name Module
     Call Unit_Price_Per_Pound Module
     Call Unit_Price_Per_Ounce Module
     Call Weight_In_Pound Module
     Call Weight_ In_Ounce Module
     Call Total_Unit_Weight Module
End Main Module

GetInput Module
     Display "Enter Unit_Name"
     Input Name*Dark Brew coffee
     Display "Enter Unit_Price_Per_Pound "
     Input Unit_Price_Per_Pound *$1
     Display "Enter Unit_Price_Per_Ounce "
     Input Unit_Price_Per_Ounce *$16
     Display "Enter Unit_Total_Weight_Pounds "
     Input Total_Weight*3
     Display "Enter Unit_Total_Weight_Ounce "
     Input Total_Weight*0
     
End GetInput Module

Calculate Weight Module
     Total_Weight in Pounds*3.00= Unit_Price_Per_Pound *$1
     Total_Weight in Ounces*2=Unit_Price_Per_Ounce*$16
Total_Weight in Pounds*3 X Unit_Price_Per_Pound *$1.00 =                                        Total_Price_Per_Pound*$3.00
Total_Weight in Ounces*2 X Unit_Price_Per_Ounce *$0.16  =Total_Price_In_Ounce*$0.32
     End Calculate Weight Module

Display Module
     Display "Dark Brew Coffee” Unit_Name
     Display "Price Per Pound is" Unit_Price_Per_Pound *$1.00
     Display "Price Per Ounce is" Unit_Price_Per_Ounce *$0.32
     Display "Your Total Today is:” Total_Price*$3.32
     Display “Thank You” Message

End Display Module

the purpose of this assigment is to display price per ounce.
In no way shape or form im looking for someone to do m homework, Please do not write the code for me i just need advice and guidence
and some help on calculating module.

*=means for example
My questions are:
Do I even need to mention pounds when I only was assigned to display ounces?
I tried VTC tutorials but are there any visual video tutorials avaliable elsewhere?

Edited by Jordan, 11 September 2009 - 04:30 AM.
Please use code tags


#2
ZekeDragon

ZekeDragon

    Writes binary right handed and hex left handed

  • Moderators
  • 2,103 posts

Quote

Do I even need to mention pounds when I only was assigned to display ounces?
I don't think so. You should be fine with just doing ounces if you weren't assigned punds, however adding the functionality to convert pounds to ounces and back sure wouldn't hurt for some extra credit. :P

Quote

I tried VTC tutorials but are there any visual video tutorials avaliable elsewhere?
I know that BlaineSch likes to pimp out his video tutorial list, so you might like to go look at what's there, you never know you could find something really helpful!

Do you need to write the code itself or just write pseudocode?
Wow I changed my sig!

#3
GreenNoob

GreenNoob

    Newbie

  • Members
  • Pip
  • 4 posts

ZekeDragon said:

Do you need to write the code itself or just write pseudocode?
Thank you for your feedback.
I just need to write it in a pseudocode. I will check the website out.

My question to all-
If you were my teacher what would you grade my paper at?

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I don't like seeing calculations on both sides of an = sign outside a comparison. I'd be docking points for that.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
GreenNoob

GreenNoob

    Newbie

  • Members
  • Pip
  • 4 posts
So my paper was graded and i received 19 out of 30 here is what my teacher wrote:

Hi Greg, wow! Way too many variables are declared. Also you need to call your
modules from the main module. For instance you do not have a module named
unit_name etc.
In your input module you ask the user to input the unit name but it should be
item name, also you hard code an actual item name so the user could never enter
a name, you have to get input of for a variable you have declared. So I would
declare ItemName and say Input ItemName.

Next you need to have your target variable on the left side of the equation and
you cannot perform math on both sides of the equation like you have. Also you
are using exact values hard coded in your math like total price per pound * 3,
you cannot do this unless it is part of the logic like to figure ounces
ounces = pounds * 16.
I really need help with my class and my reply from my teacher is "read the material it's the best one out there."
Can some one maybe assist me with tutoring??

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The biggest flaw I see is you are thinking of = as an identity symbol (like in math). That isn't what it is at all. = is assignment: it evaluates the right-hand side and takes that value and stores it in the left-hand side. You have to think of it like an excel spreadsheet: take this value, do this with it, store the result over here.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog