+ 1
How do I write a program to indicate the traffic through the switch
h.w
12 odpowiedzi
+ 5
Kindly Show your attempt First..
thank you
+ 4
i see you indicated this is h.w assuming that is homework... please show the community your attempt and the errors you end up with but please do not expect others to do your homework.
https://www.sololearn.com/discuss/1316935/?ref=app
+ 4
I don't know whether you have got to the following chapter. Passing this link in a hope you can learn or review it, and clear your doubts about `switch` statement.
https://www.sololearn.com/learn/CPlusPlus/1618/
+ 3
or do you want to understand how your code works?
+ 2
Hi! you want to say that this is a program to indicate the traffic through the switch???
this is most likely similar to a manual traffic light switching program...
+ 2
When you do a send() or recv() of data over the network, you will get a field value within the function given by the OS as to how many bytes were sent or received. You can add up these numbers to see the total number of bytes sent/received by the device.
+ 2
Sonic I wonder what language would be suitable for programming such devices? languages of the C family? this is from the field of microcontroller programming, isn't it?
+ 2
Ярослав Вернигора(Yaroslav Vernigora) I believe that C and C++ are common languages here. It doesn't have to be microcontrollers but I think that network switches and routers would have such code.
+ 1
#include <iostream>
using namespace std;
int main()
{
char z;
cin>>z;
if(z=='r')
cout<<"stop";
else if(z=='y')
cout<<"be ready";
else if(z=='g')
cout<<"walk";
else
cout<<"error";
return 0;
}
+ 1
Does h.w. stand for homework or hardware?
0
ok
0
My teacher did not explain the function of the switch