⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1d2.cpp

📁 C++ interview materials. Very helpful for interview. Including Answer.
💻 CPP
字号:
/*
NIIT 《C++ & CGI PROGRAMMING &SCRRIPTING》 Skill Base
P1.20		◆1.D.2◆
Checkup:	MrZhou
*/

#include <iostream.h>

void acceptData();
void displayData();

/* Define Variables Outside All Functions, Since More Than One Function Needs To Access Them */ 
char mobileNo[11];
char name[26];
char dateOfBirth[9];
char billingAddress[51];
char city[26];
float amountOutstanding;

/* Definition Of The main() Function */
int main()
{
	acceptData();  //Function Call 
	displayData(); //Function Call
	return 0;
}

void acceptData()
{
/* Accept Data From The User */
	cout << endl << "Please enter customer details" << endl;
	cout << "Mobile phone number: ";
	cin >> mobileNo;
	cin.ignore();
	cout << endl << "Name: ";
	cin.getline(name, 25);
	cout << endl << "Date of birth: ";
	cin >> dateOfBirth;
	cin.ignore();
	cout << endl << "Billing address: ";
	cin.getline(billingAddress,51);
	cout << endl << "City: ";
	cin.getline(city, 25);
	cout << endl << "Amount due: ";
	cin >> amountOutstanding;
	return;
}

void displayData()
{
/* Display Data */	
	cout << endl << endl << "The details of the customer are:" 
 	     << endl;
	cout << "Mobile phone number: ";
	cout << mobileNo << endl;
	cout << "Name: ";
	cout << name << endl;
	cout << "Date of birth: ";
	cout << dateOfBirth << endl;	
	cout << "Billing address: ";
	cout << billingAddress << endl;
	cout << "City: ";
	cout << city << endl;
	cout << "Amount due: ";
	cout << amountOutstanding << endl;
	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -