In this project you will be required to write a program in C/ C++, java or MATLAB thatgenerates a histogram that shows the percentage or relative frequency of packet trains thatare of a certain length.
Inputs to your program:
A “packet train” of length i is a sequence of i consecutive packets (with no gaps or idle slots in between).
In a given time slot the probability that a station has a single packet to transmit is p.? The probability of no packet in a slot (idle slot) is 1-p.? 全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写One packet fills one time slot. In your program you will need to use a random number generator function to simulate the probability that a slot has a packet or not.
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写For each of three values of p you will plot a histogram showing the relative frequency of packet trains of lenth i.? The horizontal axis of the histograms will be the packet train length (i=1,2,3…) and the vertical axis will be the recorded relative frequency.
Create a class called TextFileDriver. In the main method of this class, write a program that gives and takes advice on programming. The program starts by writing a piece of advice to the console window. It then asks the user to type in a different piece of advice. The program then ends.
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写The next person to run the program receives the advice given by the person who last ran the program. The advice is kept in a text file and the content of the file changes after each run of the program.
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写You should use a text editor (such as TextEdit or Notepad) to enter the initial piece of advice in the file. For this lab, you may assume that the advice entered by the user is no more than one line in length.
Sample output (showing two executions of the program)