Use variables: MonthlySalary, type real
OneMonthNetPayableAmount, type real
TwoYearsTotalSalary, type real
WelfareFund, type real
TotalWelfareFund, type real
TaxDeduction, type real
TotalTax, type real
DISPLAY "Please Enter the Monthly Salary"
ACCEPT MonthlySalary
WelfareFund = 0
TotalWelfareFund = 0
TaxDeduction = 0
TotalTax = 0
TwoYearsTotalSalary = 0
FOR (n = 1, n <= 24, n + 1)
If(MonthlySalary <= 10000) {
WelfareFund = MonthlySalary * 0.04
OneMonthNetPayableAmount = MonthlySalary - WelfareFund
}
Else If(MonthlySalary > 10000 And MonthlySalary < 20000) {
TaxDeduction = MonthlySalary * 0.03
OneMonthNetPayableAmount = MonthlySalary - TaxDeduction
WelfareFund = OneMonthNetPayableAmount * 0.06
OneMonthNetPayableAmount = OneMonthNetPayableAmount - WelfareFund
}
Else {
TaxDeduction = MonthlySalary * 0.05
OneMonthNetPayableAmount = MonthlySalary - TaxDeduction
WelfareFund = OneMonthNetPayableAmount * 0.08
OneMonthNetPayableAmount = OneMonthNetPayableAmount - WelfareFund
}
TwoYearsTotalSalary = TwoYearsTotalSalary + OneMonthNetPayableAmount
TotalWelfareFund = TotalWelfareFund + WelfareFund
TotalTax = TotalTax + TaxDeduction
ENDFOR
DISPLAY "One Month Net Payable Amount ",OneMonthNetPayableAmount
DISPLAY "Two Years Total Salary ",TwoYearsTotalSalary
DISPLAY "Two Years Total Welfare Fund ",TotalWelfareFund
DISPLAY "Two Years Total Tax",TotalTax
pseudo code algorithm to create a linked list
You can represent an algorithm by three different ways: 1. Pseudo Code 2. Structured flow charts 3. Actual code
An algorithm is a instruction for solving a problem. It is typically illustrated using prose, pseudo code or flowcharts, but other methods exist. The algorithm is the "here's how it's going to work" part of the solution. An implementation (of an algorithm) is a specific expression of this algorithm, using a specific programming language or any other suitable means. The implementation is the "here's how I've done it" part of the solution.
The most contradictory statement in discourse.
Ah yes, the eternal question on structured design and top-down coding.First, you need to understand the algorithm you intend to use. Write down English-like statements that describe the steps., etc., to arrive at a solution. If you can't describe what you want to do then chances are you don't understand the algorithm.Then, translate the English-like statement/paragraph into something called pseudo-code. Pseudo-code is a mixture of the English-like statement you provided and close to the grammar of the computer language you are translating to.Then, step by step, change the individual steps from your pseudo-code example into the exact grammar of the computer language you are using. Finally, take all of the variables you have declared along the way and define them.Voila! You now have the corresponding computer program that represents the algorithm you described earlier.
An algorithm is an abstract set of rules used to solve a specific problem. Pseudocode is just one of many ways to represent an algorithm.
pseudo code algorithm to create a linked list
You can represent an algorithm by three different ways: 1. Pseudo Code 2. Structured flow charts 3. Actual code
An algorithm is a instruction for solving a problem. It is typically illustrated using prose, pseudo code or flowcharts, but other methods exist. The algorithm is the "here's how it's going to work" part of the solution. An implementation (of an algorithm) is a specific expression of this algorithm, using a specific programming language or any other suitable means. The implementation is the "here's how I've done it" part of the solution.
You are going about this backwards. First, define the program. Second, describe its algorithm. Third, if needed, write pseudo code. (Sometime, algorithm and pseudo code is the same process.) Fourth, or third, write real code.
The most contradictory statement in discourse.
Ah yes, the eternal question on structured design and top-down coding.First, you need to understand the algorithm you intend to use. Write down English-like statements that describe the steps., etc., to arrive at a solution. If you can't describe what you want to do then chances are you don't understand the algorithm.Then, translate the English-like statement/paragraph into something called pseudo-code. Pseudo-code is a mixture of the English-like statement you provided and close to the grammar of the computer language you are translating to.Then, step by step, change the individual steps from your pseudo-code example into the exact grammar of the computer language you are using. Finally, take all of the variables you have declared along the way and define them.Voila! You now have the corresponding computer program that represents the algorithm you described earlier.
B. Decision StructureTony Gaddis
Ugh. Forget this... It's impossible...
duverger
Source code is a sequence of executable instructions written in a particular language. Pseudo code is a sequence of non-executable instructions. It is also called algorithm written in plain English
A pseudo-instruction : A symbolic representation in a compiler or interpreter. An instruction : a simple statement in any language that defines a task or computation etc.