Hey I am new here, I would like you to help me with a question, that is to be tested on java...
design a pseudo code that will read customer number, name, address, postcode and total amount owing, and - produce a report showing the customer's minimum amount due. The minimum amount due is calculated on the amount owing, as follows:
If the total amount owing is less than $5.00, the total amount owing becomes the minimum amount due. If the total amount owing is greater than $5.00, the amount due is calculated to be one quarter of the total amount owing, provided this resulting amount is not less than $5.00. If the resulting amount is less than $5.00, the minimum amount due is $5.00.
let me see you analyse this and i would show you how i learnt how to do.:closedeyes:
help me please : pseudo code
Started by declaration19, Apr 04 2010 01:26 PM
9 replies to this topic
#1
Posted 04 April 2010 - 01:26 PM
|
|
|
#2
Posted 04 April 2010 - 01:58 PM
Moved to the correct forum.
This isn't a hard problem at all. There are much harder problems here: Project Euler
This isn't a hard problem at all. There are much harder problems here: Project Euler
#3
Posted 04 April 2010 - 02:15 PM
WingedPanther said:
Moved to the correct forum.
This isn't a hard problem at all. There are much harder problems here: Project Euler
This isn't a hard problem at all. There are much harder problems here: Project Euler
CAN you solve it for me please...i am going on the site you sent me...
#4
Posted 05 April 2010 - 05:25 AM
I'm not understanding why you need someone to solve this for you. Pseudo code is basically you writing out the steps you would take to solve the problem. No real code is needed. Are you not sure how this would be programmed at all?
-CDG10620
Software Developer
Software Developer
#5
Posted 05 April 2010 - 09:48 AM
Yes I am new at it, and sometimes I am a bit unsure. I would like help and someone to check my codes for me. I have a little understanding of pseudo code. I am learning IF THEN ELSE, ENDIF and CASEOF. I am not asking for your answer I am just in need of someone to check my codes, please.
An architect’s fee is calculated as base fee plus a percentage of the cost of a building. The fee is determined as follows:
• A base fee of $1000 PLUS
• 8% of the first $5000 of the building PLUS
o 3 % on the excess of $5000, if this amount is less than or equal to $80,000 OR
o 2 ½% on the amount in excess of $5000, if this amount is more than $80,000
Design a program, using pseudocode, which will accept the cost of the building and calculate and display the architect’s fee.
BEGIN
Declare as real: architect’s fee, cost_of_building
IF amount <= 80,000 THEN
0.03 * 5000
ELSE
IF amount > 80,000 THEN
0.025 * 5000
ENDIF
ENDIF
architect’s_fee=1000= (0.08 * 5000)
cost_of_building = 0.08 *5000
print architect’s_fee
END
Can you tell me what flaws you see in this please. I am practicing so that I can do it properly!
An architect’s fee is calculated as base fee plus a percentage of the cost of a building. The fee is determined as follows:
• A base fee of $1000 PLUS
• 8% of the first $5000 of the building PLUS
o 3 % on the excess of $5000, if this amount is less than or equal to $80,000 OR
o 2 ½% on the amount in excess of $5000, if this amount is more than $80,000
Design a program, using pseudocode, which will accept the cost of the building and calculate and display the architect’s fee.
BEGIN
Declare as real: architect’s fee, cost_of_building
IF amount <= 80,000 THEN
0.03 * 5000
ELSE
IF amount > 80,000 THEN
0.025 * 5000
ENDIF
ENDIF
architect’s_fee=1000= (0.08 * 5000)
cost_of_building = 0.08 *5000
print architect’s_fee
END
Can you tell me what flaws you see in this please. I am practicing so that I can do it properly!
#6
Posted 05 April 2010 - 10:25 AM
A couple of things.
1. Learn how to space your if statements for easy reading like this
2. I don't think that your math on this is going to be correct. Try using variables to hold values that are needed and figure out the actual fee and cost of building based on the requirements that were stated.
Let me know if you need any clarification on this.
1. Learn how to space your if statements for easy reading like this
IF( <!-- Condition --> )
{
<!-- Do Something -->
}
ELSE IF( <!-- Condition --> )
{
IF( <!-- Condition --> )
{
<!-- do something -->
}
}
2. I don't think that your math on this is going to be correct. Try using variables to hold values that are needed and figure out the actual fee and cost of building based on the requirements that were stated.
Let me know if you need any clarification on this.
-CDG10620
Software Developer
Software Developer
#7
Posted 05 April 2010 - 10:39 AM
declaration19 said:
Yes I am new at it, and sometimes I am a bit unsure. I would like help and someone to check my codes for me. I have a little understanding of pseudo code. I am learning IF THEN ELSE, ENDIF and CASEOF. I am not asking for your answer I am just in need of someone to check my codes, please.
An architect’s fee is calculated as base fee plus a percentage of the cost of a building. The fee is determined as follows:
• A base fee of $1000 PLUS
• 8% of the first $5000 of the building PLUS
o 3 % on the excess of $5000, if this amount is less than or equal to $80,000 OR
o 2 ½% on the amount in excess of $5000, if this amount is more than $80,000
Design a program, using pseudocode, which will accept the cost of the building and calculate and display the architect’s fee.
BEGIN
Declare as real: architect’s fee, cost_of_building
IF amount <= 80,000 THEN
0.03 * 5000
ELSE
IF amount > 80,000 THEN
0.025 * 5000
ENDIF
ENDIF
architect’s_fee=1000= (0.08 * 5000)
cost_of_building = 0.08 *5000
print architect’s_fee
END
Can you tell me what flaws you see in this please. I am practicing so that I can do it properly!
An architect’s fee is calculated as base fee plus a percentage of the cost of a building. The fee is determined as follows:
• A base fee of $1000 PLUS
• 8% of the first $5000 of the building PLUS
o 3 % on the excess of $5000, if this amount is less than or equal to $80,000 OR
o 2 ½% on the amount in excess of $5000, if this amount is more than $80,000
Design a program, using pseudocode, which will accept the cost of the building and calculate and display the architect’s fee.
BEGIN
Declare as real: architect’s fee, cost_of_building
IF amount <= 80,000 THEN
0.03 * 5000
ELSE
IF amount > 80,000 THEN
0.025 * 5000
ENDIF
ENDIF
architect’s_fee=1000= (0.08 * 5000)
cost_of_building = 0.08 *5000
print architect’s_fee
END
Can you tell me what flaws you see in this please. I am practicing so that I can do it properly!
2) start by doing this by hand. For example, if you make $100,000, then your fee is:
$1000 +
0.08*$5000 + //8% of the first 5000
0.025*($100,000-$5000) //2.5% of the excess
#8
Posted 05 April 2010 - 11:12 AM
i try spacing it out...it was not so jumbled up. Hold values, ok when you say hold values what do you mean by that, my teacher must have forgotten to mention what that means..
Did I calculate incorrectly? Or did I miss out a calculation?
oh i saw my mistake
architect’s_fee=1000= (0.08 * 5000) its suppose to be 1000+(0.08 *5000) and then it would be the architects fee.
Did i print the correct variable after all the question did say to display the architects fee.
I would just like to know one thing though how are my IF THEN ELSE statements, did i do all right? Besides the lining up of the IF's and everything I know how to indent:)
Did I calculate incorrectly? Or did I miss out a calculation?
oh i saw my mistake
architect’s_fee=1000= (0.08 * 5000) its suppose to be 1000+(0.08 *5000) and then it would be the architects fee.
Did i print the correct variable after all the question did say to display the architects fee.
I would just like to know one thing though how are my IF THEN ELSE statements, did i do all right? Besides the lining up of the IF's and everything I know how to indent:)
#9
Posted 05 April 2010 - 11:15 AM
I don't understand the code you gave me, it's nothing like I've learn in school. Its either my teacher wants us to go slow. As a matter of fact the name of my course is Program design I guess its like a introductory to programming we having done any real programming on computer or anything. Sounds suck ish does it? So would you mind clarifying what you told me before please. and thanks for replying!:cool:
#10
Posted 05 April 2010 - 11:19 AM
declaration19 said:
I don't understand the code you gave me, it's nothing like I've learn in school. Its either my teacher wants us to go slow. As a matter of fact the name of my course is Program design I guess its like a introductory to programming we having done any real programming on computer or anything. Sounds suck ish does it? So would you mind clarifying what you told me before please. and thanks for replying!:cool:
The code that I put in previously was just to show you how to write If.. Else statements out. the text inside that looked like this <!-- something here --> is just a comment. The "<!--" shows the beginning of the comment and the "-->" shows the end of the comment. I was not going to bother writing out all of the logic. I just wanted to show you how the if... else statements are supposed to be written out so that you and others can understand the flow of your code better. :) Don't feel bad about moving slow. There's nothing wrong with that. Follow WingedPanther's advice. He's a pro for a reason. ;)
-CDG10620
Software Developer
Software Developer


Sign In
Create Account

Back to top









