Exercise On Nested Selection
Exercise On Nested Selection
Write a complete program using C++. Prepare the IPO, Complete Coding and
Samples of output.
1.IPO
Input
Property code, residence code, assessed value
Process
If (propertycode == 1)
If (residencecode== 1)
propertytype = Home
residencetype = Primary
tax = 0.032
Else
propertytype = Home
residencetype = Non Primary
tax = 0.041
Else
If (residencecode== 1)
propertytype = Commercial
residencetype = Building
tax = 0.062
Else
propertytype = Commercial
residencetype = Land only
tax = 0.053
Output
Property type, Residence type, assessed value, total amount
Coding
#include <iostream>
#include <iomanip>
int main()
cin >>assessed;
if (propertycode == 1)
if (residencecode == 1)
propertytype = "Home";
residencetype = "Primary";
tax = 0.032;
else
propertytype = "Home";
tax = 0.041;
else
{
if (residencecode== 1)
propertytype = "Commercial";
residencetype = "Building";
tax = 0.062;
else
propertytype = "Commercial";
tax = 0.053;
cout << "\n Assessed value entered: \tRM " << assessed;
cout << "\n Total amount that have to pay: RM " << amount;
Result