智慧旅行社需要总结客户的旅行信息。摘要报告将包含客户的旅行预订信息和付款详细信息。 [英] The wisdom travelling agency will need to summarize their customer’s travelling information. The summary report will contain the customer’s traveling booking information and total of payment details.

查看:57
本文介绍了智慧旅行社需要总结客户的旅行信息。摘要报告将包含客户的旅行预订信息和付款详细信息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

用C ++编写程序,演示您在设计解决方案时应用堆栈和队列概念,搜索和排序技术的能力。您可以使用之前的作业作为此项目的延续。您的程序应满足以下所有要求:

a)创建最少4个客户的旅行信息输入;

b)创建使用链接列表实施的客户旅行预订信息和付款细节的一(1)个或更多摘要报告。

i。使用链接列表实现创建堆栈或队列,以支持列表中显示的客户摘要报告生成。 [见图1中的例子]










智慧旅行社预订概要



客户名称:___________________________预订号:#1234

地址:________________________________________编制者: John Curtis

电子邮件:____________________________________________发行日期:8/11/18

联系号码:______________________________________

电话:___________________________________________

旅行目的地:韩国(家庭旅行)

服务说明N.人均费用酒店

(每晚)总计

机票往返3 RM8000.00 RM 24000.00

住宿酒店Armada 3 RM300 .00 5 RM 4500.00

城市旅行参加城市文化活动3 RM200.00 RM 600.00

发票小计:RM 29100.00

税/服务费:RM 4656.00

总计:RM 33756.00

图1:预订摘要的简要示例及付款详情

c)每份最终报告应该有一个预订号码,并应保存在有序列表中。管理员或系统用户可以通过搜索预订编号来查看报告。

d)您可以自由选择任何排序技术(气泡,选择,插入,外壳,快速和合并)来对您的总结报告;

e)您的系统应该能够根据用户选择连续提供下面列出的所有功能。程序界面的主要功能如下:

功能说明

菜单显示主菜单选项

添加,更新,删除客户详细信息和旅行信息能够添加/更新/删除客户的详细信息和旅行信息



搜索客户的旅行信息能够搜索客户的详细信息和旅行信息

查看客户信息及其描述能够查看所有客户的信息

汇总报告

- 显示客户旅行信息摘要,例如目的地,预订和付款详细信息按预订编号/姓名/日期排序。

退出 - 退出程序

f)您的程序应持续运行,直到用户选择终止程序;

g)在程序中创建至少五(5)条记录作为预设数据(硬编码)。



我尝试过:



Write a program in C++ to demonstrate your ability to apply stack and queue concept, searching and sorting techniques in designing your solutions. You may use the previous assignment as the continuation for this project.Your program should meet all the requirement as below:
a) Create min 4 customer’s travelling information input;
b) Create one (1) or more summary report of customer’s travelling booking information and payment details using linked-list implementation.
i. Create a stack or queue using linked-list implementation to support the customer’s summary reports generation shown in the list. [See examples in Figure 1]





The Wisdom Travelling Agency Booking Summary

Customer Name: ___________________________ Reservation No: #1234
Address: ________________________________________ Prepared by: John Curtis
Email: ____________________________________________ Issue Date: 8/11/18
Contact No: ______________________________________
Phone: ___________________________________________
Travelling Destination: Korea (family trip)
Service Description No of persons Cost per person Hotel
(per night) Total
Flight tickets Roundtrip 3 RM8000.00 RM 24000.00
Accomodation Hotel Armada 3 RM300.00 5 RM 4500.00
City travelling Attending the cultural event in city 3 RM200.00 RM 600.00
Invoice Subtotal: RM 29100.00
Tax/Service Charge: RM 4656.00
Grand Total: RM 33756.00
Figure 1: Brief Example of the Booking Summary with payment details
c) Each finalized report should have a reservation number and should be kept in an ordered list. The admin or system user can view the report by searching the reservation number.
d) You are free to choose any of the sorting techniques (Bubble, Selection, Insertion, Shell, Quick and Merge) to sort your summary report;
e) Your system should be able to provide all the functions as listed below continuously based on user selection. The key functions of your program interface are:
Functions Descriptions
Menu Display main menu options
Add, Update, Delete Customer’s Details and Travelling information Ability to add/update/delete the customer’s details and travelling information

Search Customer’s Travelling Information Ability to search customer’s details and travelling information
View Customer’s Information with its description Ability to view all the customer’s information
Summary Report
- Show summary of customer’s travelling information e.g. destination, booking and payment details sorted by reservation no/name/date.
Exit - Exit from the program
f) Your program should operate continuously until user choose to terminate the program;
g) Create at least five (5) records as pre-set data (hard coded) in your program.

What I have tried:

#include <string>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <sstream>

using namespace std;
int const MAX=5;
int top=-1;
int stack [MAX];
void push();
void pop();
void edit();
void display();
void summary();
int exit();


int main()
{
	int ch, i=0;
	system("cls");
	while (i<10)
	{
		cout << "\n The Wisdom Travelling Agency \n" << endl;
		cout << "\n1.Add Customer Detail\n2.Delete Customer Detail\n3.Edit Customer Information\n4.Display Customer ID\nView Summary Report\n6.Exit\n" << endl;
		cout << "Choose your option : " ;
		cin >>ch;
		switch (ch)
		{
			case 1: push();
			break;
			case 2: pop();
			break;
			case 3: edit();
			break;
			case 4: display();
			break;
			case 5: summary();
			break;
			case 6: exit();
			break;
		}
	}
		getch();
		return 0;

}
void push()
{
	int IDnum;
	string numphone;
    string name;
	string country;
	string email;
	int choose;

	if (top==MAX-1)
	{
		cout<<"We Are Full For A Moment! Thank You." << endl;
		return;
	}
	else
	{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<<"\nCustomer Identification Number (First 6 Number): " ;
		cin>>IDnum;
		cout<<"Customer First Name: ";
        cin>>name;
		cout<<"Customer Number Phone: ";
        cin>>numphone;
        cout<<"Customer Country Name: ";
        cin>>country;
        cout<<"Customer Email: ";
		cin>>email;
		cout << "\n The Wisdom Travelling Agency\n" << endl;
		cout << "\n1.-5 Days in Korea-\n2.-5 Days in Japan-\n3.-5 Days in France-\n4.-5 Days in Itali-\n" << endl;
		cout<<"\nPlease Choose Your Place for Vacation : ";
		cin>>choose;
		switch (choose)
		 {
		 	
		 }
		
		
		
		top = top + 1;
		stack [top] = IDnum;
		
		cout<< "\nCustomer ID : " << IDnum<<"\nInformation Was Added.";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		
	}
	
}

void pop()
{
	int IDnum;
	if (top<0)
	{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "\nCustomer Information Was Empty Already!!";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		return;
	}
	else
	{
		IDnum = stack[top];
		top=top-1;
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "Customer Detail For ID  " << IDnum << " Is Deleted!!";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";

	}
}
void edit()
{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "In Progress!!!";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
	
}
void display()
{
	int i;
	if (top<0)
	{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "\nCustomer Information Was Empty!! Please Add It First, Thank You!!";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";

		return;
	}
	else
	
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "\n The Wisdom Travelling Agency \n" ;
		cout<< "\nCustomer ID Number :\n" ;
		for (i=top; i>=0; i--)
		cout<< stack[i] << endl;
        
		

		
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
	
}
void summary()
{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<< "In Progress!!!";
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
	
}
int exit()
{
	int ch;
	cout<<"\n-------------------------------------------------------------------------------------------------------------------";
	cout<<"\nAre You Sure Want To Exit This Program?";
	cout<<"\n<1> YES!\n<2> NO!"<<endl;
	cout<<"Your Option Is: ";
	cin>>ch;
	cout<<"\n-------------------------------------------------------------------------------------------------------------------";
	if(ch==1)
	{
		cout<<"\n-------------------------------------------------------------------------------------------------------------------";
		cout<<"\nThank You For Being Our Customer! Have A Good Day.";
		exit(0);
	}	
	else 
	  return main();	
}

推荐答案

显然它是你的作业,我们不会这样做。但是我会给你一些提示。



a)开发一些概念,你想要编写代码并编写一些原型

b)使用struct或者更好的数据和函数类,如客户

c)将I / O代码与其他函数分开

d)使用更长的函数名以提高可读性

e)学习使用调试器(输出很多直到它的工作)

f)处理错误或误导用户输入

g)检查你的任务的每个部分是否已完成结束



你的退出()是错误的。调用main()是一个严重的错误,因为它是递归的。使用bool作为返回值并在main中的switch上进行检查。将此bool值设置为true。
It is obvious that it is YOUR homeworks and we wont do it. But I will give you some tips.

a) develop some concept, what you want to code and write some prototypes
b) use struct or better classes for data and functions like the customer
c) separate I/O code from other functions
d) use longer function names for readability
e) learn to use the debugger (make a lot output til its works)
f) take care of wrong or misleading user input
g) check that every part of your task is fulfilled at the end

Your exit() is wrong. Calling main() is a severe bug, because it gets recursive. Use a bool as return value and check it on switch in main. Set this bool value above as true.


这篇关于智慧旅行社需要总结客户的旅行信息。摘要报告将包含客户的旅行预订信息和付款详细信息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆