You are on page 1of 3

Analysis:

The required output is the total cost of flood insurance for a farmer who
wants to buy insurance. The necessary input variables and definitions are as
follows:

CornDCPA: Desired Coverage per Acre of Corn


CornNAP: Number of Acres Planted of Corn
WheatDCPA: Desired Coverage per Acre of Wheat
WheatNAP: Number of Acres Planted of Wheat
OatsDCPA: Desired Coverage per Acre of Oats
OatsNAP: Number of Acres Planted of Oats
IP: Insurance Percentage, 3.5%, which is equal to .035
CornCalc: (Corn DCPA*Corn NAP*IP)
WheatCalc: (Wheat DCPA*Wheat NAP*IP)
OatsCalc: (Oats DCPA*Oats NAP*IP)
Total: CornCalc+WheatCalc+OatsCalc

Insurance cost is equal to DCPA multiplied by the NAP multiplied by the


insurance percentage for each crop, then added together: The necessary
formula for this is Corn Calc*Wheat Calc*Oats Calc. So, if Corn DCPA was
$500, Corn NAP was 2 acres, Wheat DCPA is $200, Wheat NAP is 5 acres, Oat
DCPA is $300, and Oat NAP is 5 acres, the formula would be as follows:
(500*2*.035)+(200*5*.035)+(300*5*.035)=122.5, so insurance for the fields
would be $122.50.
Design:
The fundamental tasks needed to solve the problem include declaring the
input variables for Corn DCPA, Corn NAP, Wheat DCPA, Wheat NAP, Oats
DCPA, Oats NAP, IP, Corn Calc, Wheat Calc, and Oats Calc, and total, set
values for the previously listed variables, use these variables to find the total
cost of flood insurance, and printing the cost of flood insurance. Pseudocode
for this program is below:
// Pseudocode
// Main Module: This program will calculate the total cost of flood insurance
// Developer: Melissa Seely, Date: August 27th
// Module 1: Declare variables

Declare
CornDCPA,CornNAP,WheatDCPA,WheatNAP,OatsDCPA,OatsNAP,IP,CornCalc,WheatCalc,Oa
tsCalc,total as Float Numbers
//Module 2: Set values of Float Numbers. Insert each value after the =
Set CornDCPA=
Set CornNAP=
Set WheatDCPA=
Set WheatNAP=
Set OatsDCPA=
Set OatsNAP=
Set IP=0.35
Set CornCalc=CornDCPA*CornNap*IP
Set WheatCalc=WheatDCPR*WheatNAP*IP
Set OatsCalc=OatsDCPA*OatsNAP*IP
// Module 3: Set formula for calculating total cost of flood insurance
Set total=CornCalc+WheatCalc+OatsCalc
//Print total cost of flood insurance
output total

Data Sets:
Input: Desired Coverage per Acre
(DCPA) and Number of Acres Planted
(NAP)
CornDCPA: $500.00, CornNap: 2
WheatDCPA: $300.00, CornNap: 4
OatsDCPA: $660.00, OatsNAP: 1
CornDCPA: $600.00, CornNap: 10
WheatDCPA: $200.00, CornNap: 6
OatsDCPA: $700.00, OatsNAP: 8
CornDCPA: $50.00, CornNap: 9
2

Expected output: Total cost of


flood insurance (in US dollars)
Total Cost = $100.10

Total Cost = $448.00

Total Cost = $37.98

WheatDCPA: $35.00, CornNap: 7


OatsDCPA: $78.00, OatsNAP: 5

You might also like