1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
alexira [117]
3 years ago
11

Design a program using ordinary pipes in which one process sends a string message to a second process, and the second process re

verses the case of each character in the message and sends it back to the first process. for example, if the first process sends the message hi there, the second process will return hi there. this will require using two pipes, one for sending the original message from the first to the second process and the other for sending the modified message from the second to the first process. you can write this program using either unix or windows pipes.
Computers and Technology
1 answer:
Dmitry [639]3 years ago
5 0

Here's a solution in C#. Create two console applications, one for the client and one for the server. In the server, put this:

           Console.WriteLine("Listening to pipe...");

           var server = new NamedPipeServerStream("BrainlyPipe");

           server.WaitForConnection();

           var reader = new StreamReader(server);

           var writer = new StreamWriter(server);

           while (true)

           {

               var line = reader.ReadLine();

               if (!server.IsConnected) break;

               Console.WriteLine("Received: " + line);

               writer.WriteLine(ChangeCase(line));

               writer.Flush();

           }

To change case, add this function:

       public static string ChangeCase( string s)

       {

           var sb = new StringBuilder();

           foreach(char c in s)

               sb.Append(char.IsUpper(c) ? char.ToLower(c) : char.ToUpper(c));

           return sb.ToString();

       }

In the client, put this:

           var client = new NamedPipeClientStream("BrainlyPipe");

           client.Connect();

           var reader = new StreamReader(client);

           var writer = new StreamWriter(client);

           writer.WriteLine("Brainly question 13806153 demo");

           writer.Flush();

           Console.WriteLine(reader.ReadLine());

           Console.ReadLine();


You might be interested in
which network component connects a device to transmission media and allows the device to send and receive messages?
krok68 [10]

Answer: Hello!

Network Interface Card (NIC)

Explanation:

Mark me brainest please. Hope I helped! Hope you make an 100%

-Anna♥

5 0
2 years ago
What is the most useful advantage of using the Slide Sorter view to rearrange slides instead of using the slide thumbnails in No
Eddi Din [679]
<span>b. In Slide Sorter view, the user can zoom in to read text on slides more easily or zoom out to see more of the presentation’s slides at once.
Moreover, in Normal View, the number of slides that you can see together at once is quite less, so it is more advantageous to use the Slide Sorter View to sort your slides
</span>
5 0
3 years ago
What is the keyboard shortcut for opening the edit hyperlink dialog box
Mademuasel [1]

That would be CTRL+K


https://quizlet.com/122913134/keyboard-shortcuts-flash-cards/


hope this helps!

7 0
2 years ago
What component can be used for user input or display of output?
kogti [31]

Answer:

JTextField

Explanation:

JTextField is a Swing control which can be used for user input or display of output. It corresponds to a textfield and can be included with other controls such as JLabel, JButton,JList etc. on a comprehensive user interface which is application dependent. JTextField supports a read-write mode where the user can enter a value and it also supports a read-only mode which can be used to display non-editable output to the user.

4 0
3 years ago
The second letter of the Koeppen letter code gives information about:
lukranit [14]

Answer:

a. the precipitation characteristics of the climate subtype.

Explanation:

The second letter in the code represents the detailed seasonality of precipitation, it shows when during the seasons precipitation comes to that climate.

6 0
3 years ago
Other questions:
  • Which of the following payment types require you to pay upfront A. Money order and credit card B. Money orders and prepaid card
    9·2 answers
  • You are a network administrator. Your company recently approved of employees working from home one day a week and the use of emp
    7·1 answer
  • Suppose you are given a text file. Design a Python3 program to encrypt/decrypt that text file as follows:
    14·1 answer
  • Which of the following is an example of joint problem solving?
    12·1 answer
  • Edhesive 8.5 code Practice help me pls
    15·1 answer
  • Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1
    15·1 answer
  • window operating system popularly known as. 1) character user interface. 2) computer user interface. 3) graphic user interface.
    15·1 answer
  • Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input
    5·1 answer
  • write a program that prompts the user to input the length of a string as an integer, followed by the string and outputs the stri
    14·2 answers
  • Henry wants to create a presentation for his clients. He wants to upload the presentation file directly to the Internet. Which p
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!