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
Cloud computing is an old phenomenon in computing infrastructure dating back to the early days of the Internet that involves mov
denis-greek [22]

Answer:

b. False

Explanation:

Cloud computing may be defined as an on-demand availability of any computer system resources. These are especially the data storage as well as the computing power, without the direct active management by a user.

It is the delivery of the computing services which including  storage, software databases, analytics, servers, networking and intelligence.

Hence the answer is false.

6 0
3 years ago
Write a program that prompts the user to enter the area of the flat cardboard. The program then outputs the length and width of
lyudmila [28]

Answer:

A program in C++ was written to prompts the user to enter the area of the flat cardboard.

Explanation:

Solution:

The C++ code:

#include <iostream>

#include <iomanip>

#include <cmath>

using namespace std;

double min(double,double);

void max(double,double,double&,double&);

int main()

{double area,length,width=.001,vol,height,maxLen,mWidth,maxHeight,maxVolume=-1;

cout<<setprecision(3)<<fixed<<showpoint;

cout<<"Enter the area of the flat cardboard: ";

cin>>area;

while(width<=area)

{length=area/width;

max(length,width,vol,height);

if(vol>maxVolume)

{maxLen=length;

mWidth=width;

maxHeight=height;

maxVolume=vol;

}

width+=.001;

}

cout<<"dimensions of card to maximize the cardboard box which has a volume "

<<maxVolume<<endl;

cout<<"Length: "<<maxLen<<"\nWidth: "<<maxLen<<endl;

cout<<"dimensions of the cardboard box\n";

cout<<"Length: "<<maxLen-2*maxHeight<<"\nWidth: "

<<mWidth-2*maxHeight<<"\nHeight: "<<maxHeight<<endl;

return 0;

}

void max(double l,double w,double& max, double& maxside)

{double vol,ht;

maxside=min(l,w);

ht=.001;

max=-1;

while(maxside>ht*2)

{vol=(l-ht*2)*(w-ht*2)*ht;

if(vol>max)

{max=vol;

maxside=ht;

}

ht+=.001;

}

}

double min(double l,double w)

{if(l<w)

return l;

return w;

}

Note:  Kindly find the output code below

/*

Output for the code:

Enter the area of the flat cardboard: 23

dimensions of card to maximize the cardboard box which has a volume 0.023

Length: 4.796

Width: 4.796

dimensions of the cardboard box

Length: 4.794

Width: 4.794

Height: 0.001

*/

4 0
3 years ago
E. what component must be compatible with every other component of the computer?
Kryger [21]
The correct answer: The motherboard 

The motherboard which is a piece of technology which has most of the electronics of a personal computer is (usually) found at the center most part of a Central Processing unit (CPU).

The motheboard needs to be compatible with all the components found in the Central Processing Unit because almost all the important components is connected to it. Just imagine if the power which the power suppy supplies to the motherboard is inadequate due to electrical incompatibility, do you think the Central processing unit will work? It won't. As a matter of fact if you turn on the CPU, it will just switch off on itself in just a few seconds. 
8 0
2 years ago
In theory, a hacker with a small but powerful directional antenna could access a wireless network from more than one mile away.
Svetradugi [14.3K]
100 miles i assume since the avarge antanna cover 5-50 miles
3 0
2 years ago
Which tab automatically becomes available after inserting a text box? Drawing Tools Insert Text Box Tools Shape Tools
In-s [12.5K]

Answer:

insert text box

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • What is a flash player?
    9·2 answers
  • The exercise instructions here are long -- please read them all carefully. If you see an internal scrollbar to the right of thes
    15·1 answer
  • Which wireless communication technology is most likely used when synchronizing device information to an automobile?
    9·1 answer
  • Does anyone know the point of gradpoint?
    8·1 answer
  • What can act as a buffer against unemployment
    11·1 answer
  • (03.05 LC
    14·1 answer
  • What best describes the ability to increase the access to server resources and provide fail-safe services by linking two or more
    13·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    6·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!