Welcome Guest [Log In] [Register]
Welcome to Everyone Is Welcome Outreach Ministries Bringing You To Know Jesus Christ. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Insurance.cpp Assignment 2 Part A Jadeson Bynoe
Topic Started: Oct 28 2004, 12:31 AM (492 Views)
Vision
Member Avatar
Administrator Of EIWOM
[ *  *  *  *  *  * ]
//Insurance.cpp Finds the total insurance premium of a driver's insurance premium
//Jadeson Bynoe 27th October 2004

#include <iostream>
#include <string>

using namespace std;

int main()
{
//declare variables
int age = 0;
int accidents = 0;
int carValue = 0;
const double rate1 = 0.05;
const double rate2 = 0.15;
const double rate3 = 0.10;
const double rate4 = 0.25;
const double rate5 = 0.50;
float premium = 0.0;


//enter input values
cout<<"enter the age of Driver:";
cin>> age;


while (age!= 0)
{
cout<<"Enter the number of accidents for driver:";
cin>>accidents;
cout<<"Enter the value of the driver's car:";
cin>>carValue;

premium = carValue * rate1;

if (age < 25)
premium = premium + (premium * rate2);

else
premium = premium;
//end if

if (age >=25 && age <=29)
premium = premium + (premium * rate3);
else
premium = premium;
//end if

;if
(accidents == 1)

premium = premium + (premium * rate3);
//end if

;if
(accidents ==2)
premium = premium + (premium * rate4)
//end if

;if
(accidents == 3)
premium = premium + (premium * rate5)
//end if

;else if
(accidents >3)
cout<<"This Driver Has Been Refused:";

//end if

if (accidents <=3)
{
cout<<"AGE OF DRIVER:"<<age<<endl;
cout<<"NUMBER OF ACCIDENTS?"<<endl;
cout<<"VALUE OF CAR:"<<endl;
cout<<"PREMIUM:"<<endl;

}

}//end of main function
Hey the best thing has happened to me and it can happen to you to, you can believe and Pray to God and make the same decision I did, Pray ask God to forgive you of your sins and He will hear you He loves you He will forgive you and make you His child

being confident of this very thing, that He who has begun a good work in you will complete it until the day of Jesus Christ (Philippians 1:6)

KEEP COMING (Luke 18:1-8)
Offline Profile Quote Post Goto Top
 
Vision
Member Avatar
Administrator Of EIWOM
[ *  *  *  *  *  * ]
Hallelujah Glory Be To God Hallelujah
Hey the best thing has happened to me and it can happen to you to, you can believe and Pray to God and make the same decision I did, Pray ask God to forgive you of your sins and He will hear you He loves you He will forgive you and make you His child

being confident of this very thing, that He who has begun a good work in you will complete it until the day of Jesus Christ (Philippians 1:6)

KEEP COMING (Luke 18:1-8)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · School And Homework · Next Topic »
Add Reply