Professional Documents
Culture Documents
HW 1
HW 1
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:
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