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
I really need the answer now!!
guajiro [1.7K]

Answer:

3. B.

4. B.

5. B.

6. C.

7. D.

8. C.

9. C.

10. D.

Explanation:

I hope I helped you.

4 0
2 years ago
Anyone help me with number 41.
Katarina [22]
It is te = t I yhink
8 0
3 years ago
Anybody want to help me figure out how to put this on a resumè
Svet_ta [14]

Answer:

OMG IM LIKE BLUSHING AS DARK AS A TOMATO RIGHT NOW

5 0
3 years ago
Alice posts a key for encrypting that anyone can access. Bob uses that key to encrypt a message, then sends it to Alice. When Al
UNO [17]

Answer:

Public key encryption

Explanation:

DescriptionPublic-key cryptography, or asymmetric cryptography, is a cryptographic system that uses pairs of keys: public keys which may be disseminated widely, and private keys which are known only to the owner.

5 0
3 years ago
The title element in the head section of an HTML document specifies the text
bagirrra123 [75]

Answer: c. that's displayed in the title bar of the browser

Explanation:

The title element in the html write up is used to describe the title of the work that is been carried out.

It has the format <title></title>, the title name is indicated between the opening and closing title tag.

The title does not display on the main page of the Web user's display, but it can be seen on the title bar of the Web browser.

The title element help Web user to have an idea of what a Web page is about.

7 0
3 years ago
Other questions:
  • When a browser makes a request for a static web page, the web server a. finds the HTML for the page and renders it b. renders th
    11·1 answer
  • Write a method that checks whether the input string or a sentence (a string with spaces) is a palindrome or not. The method shou
    13·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    6·1 answer
  • The operating system of a computer is an example of ________ software. science-forum
    7·1 answer
  • Which layer enables the receving node to send an acknowledgement?
    11·1 answer
  • Convert the following four unsigned binary numbers to decimal and show your work:
    14·1 answer
  • Explain the basic method for implementing paging.
    13·1 answer
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • How many cubic millimeters are present in 0.0923 m3?​
    14·1 answer
  • Without using parentheses, enter a formula in cell F4 that
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!