Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming... Develop a function that has the following signature: string GetCode(char c, Code arrCodes[], const int iTotalCount) The job of this function is to

C++ Programming...

Develop a function that has the following signature:

string GetCode(char c, Code arrCodes[], const int iTotalCount) 

The job of this function is to search through the array of Codes and locate the Morse Code that corresponds to the character

char c 

that is passed in as a parameter. Once the character is located the function should return a string containing the Morse code.

My current code:

#include "stdafx.h" #include #include #include #include "Windows.h"

using namespace std;

struct Code { char symbol; string code; };

bool LoadMorseCodes(Code arrCodes[], const int iTotalCount) { int i; ifstream inFile("codes.dat"); if (!inFile.is_open()) return false;

string line; for (i = 0; i

return true; }

int main() { Code arr[36]; LoadMorseCodes(arr, 36); int i; for (i = 0; i<36; i++) cout << arr[i].symbol << " " << arr[i].code << endl; return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

List and explain the three Vs of Big Data.

Answered: 1 week ago

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago