You are the manager of a travel agency with 20 employees. You have announced a promotional campaign for your agents to sell vacation packages. Each day you will enter the ID number of the agent (#1 - #20), the number of packages sold, and the dollar value of the package. Entries will be in a random order and the total $ value is accumulated for a 3-week period. At the end of the campaign you want a print out of those agents who sold less than $2000.00 in the 3-week time frame. You will also want a list of those that did not participate in the campaign (ones with no sales). Input and output are done using files and the eof function.
Program this in c++ pls dont copy and paste the other answer that is on here it is incorrect
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
Please note there should be input file input.txt in order to run program in same directory.
#include<iostream>
#include<fstream>
#include<conio.h>
#include<iomanip>
#include<cmath>
#include<algorithm>
// Associating program identifiers with external file
names
#define in_file "input.txt"//input file name
#define out_file "result.txt"//output file name
using namespace std;
ifstream ins;// associates ins as an input stream
ofstream outs;// associates outs as an output stream
const int size=20;
int entries=0;
int agent[size]={0};
int sales[size]={0};
int tot_sales[size]={0};
float value[size]={0.0};
float amount[size]={0.0};
float sorted[size]={0.0};
float temp[size]={0.0};
bool myfunction (float i,float j) { return (j<i); }
void key_fun(ifstream& ins, ofstream& outs){//pass by
reference
ins.open(in_file);
int i=0;
int ag=0,sa=0;
float va=0.0;
/*for(int j=0;j<size;j++){
agent[j]=j+1;
}*/
outs<<"KWANTLEN TRAVEL
AGENCY"<<endl<<endl;;
outs<<"LIST OF INVALID ENTRIES"<<endl;
while(!ins.eof()){
ins>>ag>>sa>>va;
//cout<<ag<<endl;
outs<<fixed<<showpoint;
outs<<setprecision(2);
if(ag>=1 && ag<=20 && va>=0){
agent[ag-1]=ag;
sales[ag-1]=sa;
tot_sales[ag-1] += sa;
value[ag-1]=va;
amount[ag-1]+= sa*va;
}
else if((ag<1)|| (ag>20))
{
outs<<setw(2)<<ag<<"
"<<setw(2)<<sa<<"
"<<setw(7)<<va;
outs<<" **invalid agent #**"<<endl;
}
else if(va <0)
{
outs<<setw(2)<<ag<<"
"<<setw(2)<<sa<<"
"<<setw(7)<<va;
outs<<" **invalid price**"<<endl;
}
i++;
entries++;
}
outs<<endl;
ins.clear();
ins.close();
}
void display()
{
outs<<"TOTAL SALES BY AGENT"<<endl<<endl;
outs<<"AGENT NUMBER #SALES VALUE/SALE
AMOUNT"<<endl;
for(int i=0;i<size;i++)
{
outs<<fixed<<showpoint;
outs<<setprecision(2);
if((agent[i]>0)&&(agent[i]<21) &&
value[i]>=0)
{
if(tot_sales[i]>0)
outs<<setw(2)<<agent[i]<<"
"<<setw(2)<<tot_sales[i]<<"
"<<setw(7)<<amount[i]/tot_sales[i]<<"
"<<setw(7)<<amount[i]<<endl;
else
outs<<setw(2)<<agent[i]<<"
"<<setw(2)<<" 0 "<<setw(7)<<" 0
"<<setw(7)<<" 0 "<<endl;
}
}
outs<<endl;
}
void total()
{
int total_sales=0;
float average_sales;
float total_volume=0;
for(int i=0;i<size;i++)
{
outs<<fixed<<showpoint;
outs<<setprecision(2);
total_sales+=tot_sales[i];
total_volume+=amount[i];
average_sales=total_volume/total_sales;
}
outs<<"TOTAL SALES "<<total_sales<<endl;
outs<<"AVERAGE SALES VALUE
"<<average_sales<<endl;
outs<<"TOTAL VOLUME IN SALES
"<<total_volume<<endl;
outs<<endl;
}
void top3()
{
outs<<"TOP 3 WINNER OF THE SALES
CAMPAIGN"<<endl<<endl;
outs<<"AGENT DOLLAR VOLUME SOLD"<<endl;
for(int i=0;i<size;i++)
{
temp[i]=amount[i];
outs<<fixed<<showpoint;
outs<<setprecision(2);
}
sort(temp,temp+size,myfunction);
int k;
for(k=0;k<3;k++){
for(int j=0;j<size;j++){
//cout<<agent[j]<<":"<<amount[j]<<"
";
if(temp[k]==amount[j]){
outs<<setw(2)<<agent[j]<<" "<<"$"<<"
"<<amount[j]<<endl;
break;
}
}
}
outs<<endl;
}
void lessthan()
{
outs<<"AGENTS WHOSE SALES WERE BELOW $2000.00
"<<endl<<endl;
outs<<"AGENT DOLLAR VOLUME SOLD"<<endl;
for(int i=0;i<size;i++)
{
outs<<fixed<<showpoint;
outs<<setprecision(2);
if(amount[i]<2000 && agent[i]!=0)
{
outs<<setw(2)<<agent[i]<<" "<<"$"<<"
"<<amount[i]<<endl;
}
}
outs<<endl;
}
void participate(){
outs<<"AGENTS WHO DID NOT PARTICIPATE IN THE
CAMPAIGN"<<endl;
for(int i=0;i<size;i++){
if(agent[i]==0)
outs<<i+1<<setw(4);
}
outs<<endl;
}
int main()
{
outs.open(out_file);
key_fun(ins,outs);//passing input and output file by
reference
display();
total();
top3();
lessthan();
participate();
outs.close();
}
Kindly revert for any queries
Thanks.
You are the manager of a travel agency with 20 employees. You have announced a promotional...
please disregard the excel question
А B D Question 1 -- Stacy's Travel Agency 2 3 8 Instructions 4. You are an agent at a local travel agency. Your manager has asked you to track your sales of next winter's holiday packages. For each package, customers can schoose whether or not to include a flight in the package. For each sale, an initial down payment of 20% of the total package cost is required. 6 Customers can pay the remainder...
I have homework i was answered it .. but i need you to complete my answer to become 1000 words // i need 1000 words please use your own words, don't copy and paste, don't use handwriting, please. i need your references URL Link please** Book: Marketing Management ________________ Q: DEVELOP A CREATIVE BRIEF A creative brief is a structured document whose purpose is to communicate quickly and concisely to anyone who might be involved in the creation of promotional...
SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...
internal project 1
anything helps! thank you!!
Instructions: Study the case that starts on page 3 carefully. Then write concise answers to the following questions regarding the internal control system of Duarf, Inc. Clearly label your responses with proper headings and subheadings. Be very specific and precise. Answers that appear to be beating around the bush will not get any credit. 1. What are the controls in place that under normal conditions should function well to prevent embezzlements or frauds?...
Develop a case study analysis in the following format
Relevance of the case study to my work
environment
- application
- learning impact
CASE 4-1 Tambrands Overcoming Cultural Resistance Tampax, Tambrands's only product, is the best-selling tampon in their virginity if they use a tampon. When they go to the beach in the world, with 44 pencent of the global market North America and tiny bikinis, tampons arent their choike. Instead, hordes of women Europe account for 90 percent of...
Trader Joe's Keeps Things Fresh CASE 1A Trader Joe’s Keeps Things Fresh The average Trader Joe’s stocks only a small percentage of the products of local supermarkets in a space little larger than a corner store. How did this neighborhood market grow to earnings of $9 billion, garner superior ratings, and become a model of management? Take a walk down the aisles of Trader Joe’s and learn how sharp attention to the fundamentals of retail management made this chain more...
HDT Truck Company HDT Truck Company has been located in Crown Point, Indiana, since 1910. Its only products— large trucks—are built to individual customer specifications. The firm once produced automobiles but dropped out of the auto business in 1924. The firm nearly went out of business in the late 1930s, but by 1940 its fortunes were buoyed by receipt of several military contracts for tank retrievers—large-wheeled vehicles that can pull a disabled tank onto a low trailer and haul it...
What happened on United flight 3411?What service expectations
do customers have of airlines such as United and How did these
expectations develop over time?
Thank You!
In early April 2017, United Airlines (United), one of the largest airlines in the world, found itself yet again in the middle of a service disaster this time for forcibly dragging a passenger off an overbooked flight. The incident was to become a wake-up call for United, forcing it to ask itself what to...
Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...
How can we assess whether a project is a success or a
failure?
This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...