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

📄 currency.h

📁 一本语言类编程书籍
💻 H
字号:
// Exercise 11.1 A currency converter    File: currency.h
// currency.h Definition for Currency structure
#ifndef CURRENCY_H
#define CURRENCY_H

// Structure representing a currency
struct Currency {
  char name[20];                    // Currency name
  double amount;                    // An amount in this currency
  double rate;                      // Value of 1 unit of this currency in US dollars
  char code[4];                     // Currency code - 3 characters e.g. "USD"

  double convert(Currency amount);  // Convert amount to this currency
  void set_amount(double amount);   // Set an amount in this currency
  void show();                      // Display the amount of this currence
};

#endif

⌨️ 快捷键说明

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