Congestion in a network may occur if the load on the network is greater than the capacity of the network. The congestion control scheme tries to bring the network back to an operating state, while a congestion avoidance scheme tries to keep the network at an optimal state. The instant at which a congestion control scheme is called, depends on the amount of memory available in the routers whereas, the point at which a congestion avoidance scheme is invoked, is independent of the memory size. A congestion avoidance scheme may continuously oscillate slightly around its goal without significant degradation in performance. However, the congestion control scheme tries to minimize the chances of going above the limit.
As a network administrator, in your opinion, which of following technique will be more suitable for a WAN?
(1) Congestion Avoidance
(2) Congestion Control
A student in Programming 1 wants to know the surface area and volume of a cylindrical shape.
Figure 5.1: Example of a cylinder
Volume = PI(R^²) x height
Area = 2PI(R^²) x height + 2PI(R^²)
5.1.1 Write a program that will assist the students:
5.1.2Create a C++ source file called Cylinder and save it in a file called Cylinder.cpp.
5.2 Create the following functions:
5.2.1 calcVolume() This function will receive three parameters and it must then calculate
and return the volume of a cylinder using the information given
above.
5.2.2 calcArea() This function will receive three parameters and it must then calculate
and return the area of a cylinder using the information given above.
5.2.3 main() NB: The functions must be implemented above the main.
Add all necessary pre-processor directives.
Declare all constants and necessary variables.
Prompt the user for the height of the cylinder, and the radius of
the base of the cylinder.
Based on the users option :
o Do the relevant calculations by calling the correct
function.
Display the results of the desired measurement.
If an invalid option is selected an appropriate error message
must be displayed, see Figure 5.5.
NB: Use a switch for the selection
o This process must be repeated until there no calculations to
perform (N/n).
Define a function that takes an argument. Call the function. Identify what code is the argument and what code is the parameter.
Your friend is developing a maze puzzle game and already designed a module which can generate a random maze. The maze has one entry and one exit point. Now he needs to develop the module which will find the path from entry to exit points for randomly generated maze. Your friend wants the path searching should be quickest. He can use only Stack or Queue data structures to store maze’s visited locations for path generation. He is unable to decide the selection of data structure and asked you to help him.
GDB Question:
From Stack and Queue data structures which data structure you will suggest using for entry to exit path finding module? Select a data structure and give comments in favour to justify your selection. Also mention why you are not selecting the other data structure?
Write a temperature conversion GUI that converts from farenheit to celsuis
Create a super class called car.
a. The car class has the following fields and methods.
- Intspeed:
-doubleregularPrice:
- stringcolor: doublegelSale Price()
b. Creote a sub class of car class and name It as pickup. The following fields and methods.
- intweight:
- doublegetSidePrice()
If weight is greater than 2000. 15% discount otherwise 25%
c. Create a sub class and name it as Nissan. The follwing fields and methods.
- Intyear;
-intmanufacturerDiscount:
-doublegetsdePrice()
From the sale price computed from car class. subtract the manufacturer discount
d. Create a sub class and name it is methods
-. Intlength:
-doublegetSalePrice()
If length is less than 20 feet. 10% discount. Otherwise, 15% discount.
e. Create a MyShop class which contains the main method. Perform the following within the main() method.
-Create an instance of Toyota class and initialize all the fields with appropriate values. Use super (...)method in the constructor for initializing the fields of the super class.
-Create two instances of the Nissan class and initialize all the fields with appropriate values. Use super(...) method in the constructor for initializing the fields of the super class.
-Create an instance of car class and initialize all the fields with appropriate values. Display the sale prices of all instance.
The below, python dictionary (my_fruits_dic) holds fruits and their price.
my_fruits_dic = {
"Fruit": "Price",
"apple": 6.44,
"banana": 0.77,
"orange": 3.44,
}
(1) Add a new item "berries" with the value {blackberry: 1.24, blueberry: 3.14}.
Print myDic. (This new dictionary will be added without the berries key. It needs to be added as a nested dictionary under berries key).
Write a function that takes a string and split it by words to array of strings.
Overload the addition operator to add an 8-bit integer to a boolean.
Fill in the blanks in the following code. The code is written to draw 4 rectangles of heights 20, 30, 40, 50 respectively and widths 20, 15, 10, 5 respectively. The centres of these rectangles are at (1,2)
initCanvas();
double x=20;
double y=20;
repeat(4){
Rectangle r( BLANK-P , BLANK-Q , x, y);
r.imprint();
x = x + BLANK-R ;
y = y + BLANK-S ;