Posts

Showing posts with the label Telegram

In Cpp/C++, Demonstrate Telegram Bill And Morse Code Translation

Image
#include<iostream> #include<string> using namespace std; void telegramBill(); void morseCode(); int main(){ int choice; cout << "Welcome to Western Union Telegram Company" << endl << endl; cout << "1 - Process Telegram Bill" << endl; cout << "2 - Translate to Morse Code" << endl << endl; cout << "Enter your choice: "; cin >> choice; cin.ignore(); switch(choice){ case 1: telegramBill(); break; case 2: morseCode(); break; default: cout << endl << choice << " is not a valid choice." << endl; } return 0; } void telegramBill(){ const double RATE_PER_FIVE = 1.50; const double RATE_PER_SINGLE = 0.50; string custName, street, city, state, zip; int words, blockFiveWords, remSingleWords, payment, change, dollars, quarters, dimes, nickels, pennies; double amountDue; cout << "Enter the name of the customer: ";...