Help with Code

i have to write a code to figure out medical the price of out of pocket premiunms and I'm having some issues with it if you could help me i would really appricate it heres the question and the code is under it this is my first time posting on this forum and if you could help me i would really appreciate it.


• Medical
• Employee-only: $0
• Employee+spouse: $50
• Employee+child(ren): $100
• Employee+family: $200
• Dental
• Employee-only: $50
• Employee+spouse: $125
• Employee+child(ren): $225
• Employee+family: $325
• Vision
• Employee-only: $25
• Employee+spouse: $60
• Employee+child(ren): $110
• Employee+family: $185

Premium discount
• If employee has 20+ years of service, they get 20% discount from the total premium.
• If 10 - 20 years of service, 10% discount

Inputs from user
• Benefits selections: Medical, Dental, Vision
• Use Employee-only: e
• Employee+spouse: s
• Employee+child(ren): c
• Employee+family: f
• Years of service

For example:
Enter your selections
Medical: f
Dental: c
Vision: e
Years of service: 15
Total out-of-pocket premium: 405.00

Here is the calculation…
(200+225+25)-10%(200+225+25) = 450-45 = 405



and heres the code ive been woring on my problem is i don't know how to define the different types of variables

#include "stdafx.h"
#include <iostream>
#include <string>

using namespace std;

int main()
{
enum benefits {medical, dental, vision};
int e, s, c, f, benefits, benefits_2, benefits_3, discount;
string outputs, e,s ,c,f;
cout << "medical: ";
cin >> benefits;
if (benefits == e) {
e = 0;
}
else if (benefits == s) {
s = 50;
}
else if (benefits == c) {
c = 100;
}
else if (benefits == f) {
f = 200;
}
cout << "dental:";
cin >> benefits_2;
if (benefits_2 == e) {
e = 50;
}
else if (benefits_2 == s) {
s = 125;
}
else if (benefits_2 == c) {
c = 225;
}
else if (benefits_2 == f) {
f = 325;
}
cout << "vision: ";
cin >> benefits_3;
if (benefits_3 == e) {
e = 25;
}
else if (benefits_3 == s) {
s = 60;
}
else if (benefits_3 == c) {
c = 110;
}
else if (benefits_3 == f) {
f = 185;
}
cout << "years of service:";
cin >> discount;
if (discount >= 20) {
(benefits + benefits_2 + benefits_3) - 20

}
system("pause");
return 0;
}
Topic archived. No new replies allowed.