Hello all this is my first post, I know i'm not supposed to just ask for answers so i given it a solid go and I'm stumped, i don't know all that much so i'm sure its a few little things but any help would be great. Here's what i'm supposed to be doing and what I've got.
Write a program in C to calculate the insurance premium for a building (house) insurance. The premium depends on the amount insured and also has a processing charge of $50. Customers are charged 0.3% of the amount insured, where the insured amount is less than $100,000, and 0.25% for other amounts. Customers that have zero claims receive a 10% reduction in their total premium as a no claim bonus. The amount insured is always a multiple of $1000.
Code:
#include <stdio.h>
int main()
{
int amountinsured, numberofclaims, premium, noclaimbonus;
printf("Input amount insured:");
scanf(" %d", &amountinsured);
printf("Input number of claims:");
scanf(" %d", &numberofclaims);
if (amountinsured<100000)
{
premium=(amountinsured*.003)+50;
}
else
{
premium=(amountinsured*.0025)+50;
}
printf("Amount Insured:%d\n",amountinsured);
printf("Number of Claims:%d\n",numberofclaims);
if (numberofclaims = 0)
{
noclaimbonus = premium*.1;
premium = premium - noclaimbonus;
printf("No claim bonus:%d\n",noclaimbonus);
}
printf("Premium:%d\n",premium);
return 0;
}