PLease don't copy I need new code

c++

The acronym for a given string is formed by combining the first letters from a series of words, as in this example: "self contained underwater breathing apparatus" ==> "SCUBA".

Your program generates and displays the acronyms for each of the strings in a data file named “acronym.dat”.

The output of your program should be of the following format:

Self contained underwater breathing apparatus ==> SCUBA

White anglo saxon protestant ==> WASP

……

North Atlantic Treaty Organization ==> NATO

The strings in the data file may have mixed upper and lower letters. You may assume that no hyphen and underscore, and no punctuation marks is present in the data file. The acronyms generated should all be in upper case letters. Your program output should have the exact format as shown above.

You are required to write a value-returning function to convert one line of characters into its corresponding acronym. This function needs to be called within a loop that reads lines of characters from the data file one line at a time, and performs the acronym conversion.

acrynom.data

Self contained underwater breathing apparatus
White anglo saxon protestant
North Atlantic Treaty Organization
Defense Advanced Research Projects Agency
Laugh Out Loud
By the way
Best Friends Forever
I Love You
In my humble opinion
Oh my god
Wicked Evil Grin
Wish you were here
National Science Foundation
National Institute Health

#include
using namespace std;

int main() {


return 0;
}

describe/define each variable used in that module. Variable names must be descriptive. Separate variable definitions from variable descriptions. Use the following form for this description: variable declared; // variable description in English sentence(s)

Properly indent all code according to descriptions given in “Indent C Programs” (http://www.cs.arizona.edu/~mccann/indent_c.html). You must be consistent in the number of spaces used for indentation.

• To improve readability, use a moderate amount of white space, i.e., insert blank lines between blocks of code, and between different modules/functions.

• Comments need to be written for each logically related block of code. This include a while or for loop, a if decision statement, a switch statement, a group of statements that compute a value, a block of code that read in user data, a group of statements that displays output, etc.

4. For each user defined function, comments need to be written above the function describing:

o What does this function do?

o What are the expected input values?

o What are the expected return values?

Respuesta :

Using knowledge of computational language in C++ it is possible to write a function that "self contained underwater breathing apparatus"SCUBA". In this program generates and displays the acronyms for each of the strings in a data file named.

Writting in C++

#include<iostream>

#include<fstream>

#include<string>

using namespace std;

// Your program is required to have at least one user-define function.

// This function takes one string as input and returns the acronym corresponding to that string.

string getAcronym(string str){

string message = "";

if(str[0]>='a' && str[0]<='z')

message += str[0]-32;

else

message = str[0];

for(int i=1; i<str.length()-1; i++)

{

if(str[i-1]==' '){

if(str[i]>='a' && str[i]<='z')

message += str[i]-32;

else

message += str[i];

}

}

return message;

}

// Write a C++ program named acronym.cc

int main(){

// Your program generates and displays the acronyms for each of the strings in a data file named

See more about C++ at brainly.com/question/19705654

#SPJ1

Ver imagen lhmarianateixeira