answersLogoWhite

0


Best Answer

#include<iostream>

#include<string>

#include<vector>

std::string encode (const std::string&);

std::string decode (const std::string&);

int main () {

std::vector<string> strings;

std::cout<<"Enter as many strings as you like (end with an empty string)\n";

while (true) {

std::string input;

std::cout<<"Enter a string: ";

std::getline (std::cin, input);

if (input.empty()) break;

strings.push_back (encode (input));

}

std::cout<<"You entered the following strings:\n";

for (auto s : strings) std::cout<<decode (s)<<std::endl;

}

Note that it is not possible to show the implementation details of the encode and decode functions since it is not clear from the question what the purpose of these functions is.

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program that allows the user to enter any number of strings that will then be encoded decoded and then displayed to the console?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Import liberation program?

The import liberation program is an application that allows files to be easily decoded and shared in a liberal format. This means that such files will not have complex restrictions.


When you point to a program button on the taskbar what is displayed?

thumbnail


What is a program that removes certain items from being displayed?

Web filters


What is A program that removes or blocks certain items from being displayed?

A Filter


Is a program that remove or block certain items from being displayed?

A Filter


Rectangular area that is displayed on the desktop where the program runs?

It is the application window.


What are the program file name and extensions to the Microsoft management console?

.msc


What is the output displayed by the following program when the data entered are 5 and 7?

Impossible to say without seeing the program's source.


How do you pause the screen at visual studio 2008?

When debugging console applications using F5, the default behaviour is to close the console window as soon as the program exits. You can prevent this by placing a breakpoint on the return statement(s) in your main() function. Alternatively, you can run the program outside the debugger with CTRL+F5. This is the same as running the program from the command line and the console window will remain open when the program exits.


What are the release dates for Ice Climber - 1985 VG?

Ice Climber - 1985 VG was released on: Japan: 30 January 1985 Japan: 31 August 2011 (3DS Ambassador program Virtual Console release) Australia: 1 September 2011 (3DS Ambassador program Virtual Console release) UK: 1 September 2011 (3DS Ambassador program Virtual Console release) USA: 1 September 2011 (3DS Ambassador program Virtual Console release)


Write a program in C for arithmetic operations between two integers your program should guide users with proper message or menu on the console?

Write a program in C for showing working of different logical operator in C.Your program should guide users with proper message/menu on the console. (5 Marks)


A program that removes or blocks certain items from being displayed?

A pop-up ad