An Insurance corporation follows following policies to calculate premium.
(1) If a person’s health is remarkable and the individual is between 25 and 35 years of age and lives in a metropolis and is a male then the premium is Rs. four per thousand and his policy quantity cannot exceed Rs. 2 lakhs.
(2) If a individual satisfies all the above prerequisites besides that the sex is woman then the premium is Rs. 3 per thousand and her coverage quantity cannot exceed Rs. 1 lakh.
(3) If a person’s fitness is negative and the individual is between 25 and 35 years of age and lives in a village and is a male then the premium is Rs. 6 per thousand and his policy cannot exceed Rs. 10,000.
(4) In all other cases the individual is no longer insured.
Write a program to output whether the individual ought to be insured or not, his/her top rate fee and most amount for which he/she can be insured.
(1) If a person’s health is remarkable and the individual is between 25 and 35 years of age and lives in a metropolis and is a male then the premium is Rs. four per thousand and his policy quantity cannot exceed Rs. 2 lakhs.
(2) If a individual satisfies all the above prerequisites besides that the sex is woman then the premium is Rs. 3 per thousand and her coverage quantity cannot exceed Rs. 1 lakh.
(3) If a person’s fitness is negative and the individual is between 25 and 35 years of age and lives in a village and is a male then the premium is Rs. 6 per thousand and his policy cannot exceed Rs. 10,000.
(4) In all other cases the individual is no longer insured.
Write a program to output whether the individual ought to be insured or not, his/her top rate fee and most amount for which he/she can be insured.
#include<iostream>
using namespace std;
int main()
{
int age;
char health , location , gender;
cout << "Enter your health state (e for excellent and p for poor): " << endl;
cin >> health;
cout << "Enter your age: " << endl;
cin >> age;
cout << "Enter your location (c for city and v for village): " << endl;
cin >> location;
cout << "Gender (m for male and f for female): " << endl;
cin >> gender;
if( (health == 'e') && (age > 25 && age < 35) && (location == 'c') && (gender == 'm') ){
cout << "The premium is Rs. 4 per thousand and his policy amount cannot exceed Rs. 2 lakhs. " << endl;
}
else if((health == 'e') && (age > 25 && age < 35) && (location == 'c') && (gender == 'f') ){
cout << "The premium is Rs. 3 per thousand and her policy amount cannot exceed Rs. 1 lakh. " << endl;
}
else if( (health == 'p') && (age > 25 && age < 35) && (location == 'v') && (gender == 'm') ){
cout << "The premium is Rs. 6 per thousand and his policy cannot exceed Rs. 10,000. " << endl;
}
else{
cout << " The person in not insured: " << endl;
sir can you do this ques without char type
ReplyDelete