Epic Systems Interview Question Software Engineer / Developers
0of 0 votesyou are to write a program that figures out the total cost of an airline ticket. The base-fare is $40, tax rate is 4%, a customer is charged $10 per segment but only a maximum of 2 segments will ever be charge, and $10 per security screens but only a maximum of 3 security segments will ever be charged. Something like that, simple linear programming.

#include<iostream.h>
- Shivi on November 21, 2011 Edit | Flag Reply#include<conio.h>
void main()
{
int bfare=40, trate, tcost,seg, sscr;
trate=(4/100)*40;
tcost=bfare+trate;
cout<<"Segment";
cin>>seg;
cout<<"Security Screens";
cin>>sscr;
if(seg<=2)
tcost=tcost+10;
if(sscr<=3)
tcost=tcost+10;
cout<<"Total cost is:"<<tcost;
}