Question No.1 (10 Marks)
Let us consider a computer network in which each computer has number of I/O ports equal to 8. In this network every device has dedicated point to point link to every other device. You are required to fill in the following table with correct
Solution:
Number of Computers= Number of Ports+1=8+1=9
Number of Links= s(s-1)=9(9-1)/2=36
Question No. 2 (5 Marks)
Write the correct Transmission Mode for each of the following hardware devices in the given table?
Solution
Mouse.......................................................Simplex
Scanner......................................................Simplex
Walkie-Talkie.............................................Half Duplex
Telephone...................................................Full Duplex
Fax Machine...............................................Half Duplex
E-learning is fastest way of building knowledge. This simple blog is designed to provide knowledge based Computer E-learning.
Showing posts with label Virtual University of Pakistan. Show all posts
Showing posts with label Virtual University of Pakistan. Show all posts
Tuesday, 18 November 2014
cs201 Assignment 1
A Game Generates Random Secret Number from given Range
Analysis of The Game:-
This is a cute random number generation game. We have following terms for the game.- The user gives the input to the game in the form of random numbers i.e Lower Limit and Upper Limit.
- Then the computer Generates a random secret Number and stores it in its memory.
- The computer then asks the user to guess the Number by a prompt.
- If the user Number is less then the secret Number it Returns a Message.
- If The Number is Equal To the Number it gives the 2nd Message.
- If Number is Greater then the Secret Number it shows the Third Message.
The Process Involved in the Game:-
The game includes following header files atleast#include<iostream.h>
#include<stdio.h>
using namespace std;
The process of the game usually starts with the main function.
main( )
{
}
Now as we analyze earlier we have 4 integer values in the game
int SecertNumber
int UserNumber
int LowerLimit
int UpperLimit
- The secret number is the number generated by computer.
- The user Number is the number asked by the computer as a guess. So user will input that number.
- The LowerLimit and UpperLimit are also prompted from user.
- Note that all number should be equalize to 0 while defining.
ask the user to enter upper and lower limits at this stage
cout << "Please Enter the Lower Limit="
cin >> LowerLimit
cout << "Please Enter the Upper Limit="
cin >> UpperLimit
Now it is the Time to Generate a Random Secret Number
srand(time(NULL))
SecretNumber = rand()%upperlimit+lowerlimit
cout<<"Done!"<<endl<<endl
Well NOW ONLY THING YOU NEED IS TO GENERATE THE TEST FOR YOUR RANDOM GENERATED NUMBER
ask the user to Guess the secret number
cout << "Please guess the secret Number"
cin >> UserNumber
NOW USE IF , ELSE IF and ELSE To show weather the Number is > then SecretNumber, OR IT IS > then SecretNumber or == to the SecretNumber
HURRAH HERE GOES THE CODE FOR THE GAME.
.
.
.
THANKS TO OUR TEAM IN THE BASEMENT
Subscribe to:
Posts (Atom)