0 votes
in Programming Languages & Algorithms by

Construct a solution algorithm for the following programming problems. Your solution should contain:

• A pseudo code algorithm

• A desk check of the algorithm. An architect's fee is calculated as a percentage of the cost of a building. The fee is made up as follows:

8% of the first $5000.00 of the cost of a building and 3% on the remainder if the remainder is less than or equal to $80 000.00 or 2.5% on the remainder if the remainder is more than $80 000.00.

Design an algorithm that will accept the cost of a building and calculate and display the architect's fee.

1 Answer

0 votes
by

Pseudo code algorithm: Using the defining diagram, the algorithm can be constructed.

The processing component of the diagram specifies the actions to be performed to complete this program. The solution algorithm is follows:

Calculate architects fee

1.Prompt for building cost

2. Get building cost

3. Remainder = building cost - $5,000.00

41 IF remainder < $80,000.00 THEN architects fee = ($5,000.00 * 8%) + (remainder * 3%)

ELSE

Architects fee = ($5,000.002 * 8%) + (remainder * 2.5%)

ENDIF

Display "architect's fee is " architects fee

END

C) Desk Checking of the algorithm:

1. Choose input data:

Two sets of valid character will be used to check the algorithm, the $40,000 as first set, and $100,000 as the second set.

First data set

Second data set

Building cost

$40,000

$100,000

2. Expected Result:

The expected results for the two sets of test cases are given below:

First data set

Second data set

Architects fee

$1,450

$2,775

3. Desk check table:

Set up a table of variable names and then pass each test data set through the solution algorithm, statement by statement. Using the algorithm line numbers as indicated.

Statement

Building cost

Remainder

Architects fee

First pass

Get

$40,000

Remainder

$35,000

IF

$1,450

Display

Yes

Second pass

Get

$100,000

Remainder

$95,000

IF

$2,775

Display

Yes

4. Comparing expected and actual results:

The expected results matches the actual results obtained for each set of data.

Related questions

Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...