Question
Hello please pay attention to my project, the project started from one upto three, if you don not do one you can not do two
Hello please pay attention to my project, the project started from one upto three, if you don not do one you can not do two and three, and please use c++ programming language also if you can don not use online source because I don not like to get in trouble. please make the program for three of them and put them under each of the questions. ThANKS
Project 1
This project lays the foundation for a series of programs which address various problems in computer networking. Before diving into the complex problems, it is important to build experience with the programming language and techniques we will use to solve them. As demonstrated in class, the syntax of C++ is very similar to Java, so establishing a level of comfort while exercising problem-solving skills is emphasized here rather than minutiae of the language. Those details will be incorporated into later projects through application. Keep in mind that there are many resources to learn the syntactic details of C++. The required and recommended textbooks listed in the Syllabus and the class slides are good resources. Using the internet to find additional resources is encouraged, however the policy on plagiarism is clear and very strict. Do not copy and submit code which is not your own. Problem Description This phase of the project will establish two classes. Their specific implementation details are flexible, but they should meet the following requirements: NetworkObject This class called NetworkObject defines the abstract properties of an element of our network. Additional capabilities will be added to classes derived from this base class in order to power future projects. The class should contain at least the following private variables: ? int objectId The class should contain at least the following public methods: ? NetworkObject(int objectId) ? Constructor which sets the objectId when an object is created. ? int getObjectId() ? Returns the objectId variable Server This class is a dummy derived class to which we will add complexity in future projects. The class should inherit from the NetworkObject class (we will go into detail about inheritance in the 2/10 lecture). For now, it requires no additional functionality beyond a constructor method. Other Requirements In your main function, choose a way to store a number of NetworkObject objects?. This may be an array, a vector, a linked list, etc, it is your design choice at this stage. The main function should then instantiate some objects ?and then print? their objectIds using the functions and classes created above.
Project 2
In Project 1 we laid the foundation of what will become a simple network packet transmission simulation. This project will build upon this foundation, utilizing a queue structure to store atomic packets of data which will travel across the network. The advantage of a queue is that, once a routing system is constructed in Project 3, latency will naturally be minimized as packets are essentially prioritized by wait time. Please construct the following class, defined in a file named Packet.h, and define the function bodies in a separate Packet.cpp file: Packet This class should contain the following private variables. You should define public functions which get and set the values of these variables. An integer called targetID An integer called sourceID A string called data Network Object This class (from Project 1) should be modified to contain a private queue variable called packets. I'm trusting that you will recall the form of a FIFO queue from CSC 220 Data Structures. For those who do not recall, the queue will be an easy subject to Google and learn about. How you decide to implement the queue is up to you, so long as it functions according to the normal FIFO expectations of a queue and stores packet objects. More accurately, you will find that storing pointers to packet objects will be far superior than the actual packet object. As we discussed in class, the power of the pointer is in its ability to reference large objects in a compact, easily accessed way. We will use this queue of packets in Project 3 to begin routing packets between network objects and begin to simulate communication between network objects.
Project 3
his project concludes the network-oriented series that we began at the start of the semester. Its purpose is to act as a foundation to a simulation you can easily expand upon and add features to, while demonstrating a large number of the concepts weve covered so far in the course. FOR 50% EXTRA CREDIT ON THIS PROJECT: ?In the last lecture, we discussed the use of the averaging many random trials to determine the expected behavior of a system. In order to do this, we can sample the important variables of the system from a (often uniform) probability distribution for each computation. After each run of the system with random values, we can compute the results were interested in and take an average. The average results were interested in for the extra credit are: 1. Average percentage of packets lost. 2. Average travel time of a packet. Regardless of whether or not you would like to do the extra credit, ?well want to generate the following variables randomly. Where they are generated should be fairly obvious based on what they do. 1. numberOfNodes?: The number of nodes in the linked list (i.e. the number of network objects). 2. probabilityOfPacketLoss?: How often a node will drop a packet 3. maxPackets?: How many packets each NetworkObject can hold. This should be the size of your packets? Queue. For simplicity, this value can apply to all NetworkObject nodes, rather than generating a different value for each node. For your own practice, you might try doing this anyway. For simplicity in this project, we will hold the packet source and target fixed at the beginning and end of the linked list. The modifications for this project can take place in main() and whatever helper functions you see fit to create. However, the following additions must be made to the NetworkObject class: NetworkObject 1. Define the randomly generated integer maxPackets? 2. Define a function addPackets?, which adds an array of packet objects to the packets? queue. 3. Define a function getPackets?, which returns a number n ?packets from the packets? queue. The packet objects should obviously be removed from the queue, then returned. 4. Define a function update, ?which removes as many packets as possible, up to the maxPackets? value, and adds them to the packets? queue in the next node. For each packet, use the probabilityOfPacketLoss? variable to determine if a packet should be added to the next NetworkObject, or simply removed. Keep count of how many packets are dropped?. This will be important later. Note: ?There are a few things to consider here: a. There may not be a next node. In that case, the packets should just be removed from the queue. b. Do you want to compute travel time in this function when there is no next node? c. The nextNetworkObject may not be able to accept all of those packets! Only remove the packets that can be added successfully to the nextNetworkObjects queue. Main 1. Define a random number of NetworkObjects and link them together in a Linked List as weve been doing in the previous projects. 2. Loop over the following operations a large number of times (e.g. 1,000 times): a. Add a random number of packet objects to the first? NetworkObject. Keep a running total of this number. b. Call the update() ?function on every? NetworkObject in the linked list. 3. When the loop is done, output the following: a. How many nodes were in the linked list b. How many packets traveled through the system c. How many packets were lost. This can be expressed as a percentage by dividing the total number of packets lost by the total number of packets created, and multiplying by 100. 4. For the extra credit, perform steps 1, 2, and 3 a large number of times, and output the average of the results above.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started