john daniels

Greenhorn
since Dec 11, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

Recent posts by john daniels

Well nobody was able to help me in the intermediate section, so I thought I would give the advanced section a shot, I am stuck, and really dont know what to do past this point.

Ok I am having trouble with an assignment I am doing for my class.
The Assignment is as follows:

Compare the performance of a 4-computer network in the following situations:

- First Come First Serve (the first computer to have a message available gets complete control of the network until transmission is done).

- The network uses Time Division Multiplexing with computers taking turns with one packet (10 Kb) being sent every time.

- The same as the situation before except that computers with nothing to send forfeit their turns.

Turn in a report (with a cover page) comparing the performance of the network in all 3 situations. Also turn in any code used to generate the report or create the simulation. Calculate the average wait time for all messages.

Rules:

- In each of the three situations 100 random-sized messages need to be sent. The size will vary between 10 K and 15 MB (in increments of 10 K).

- The transfer rate is 96 K/ sec.

The part I am have trouble with is step two: - The network uses Time Division Multiplexing with computers taking turns with one packet (10 Kb) being sent every time.

I can not figure out how to divide it up sending 10Kb at a time, and then giving the total time to send all four messages. Anyone able to help me out?

This is the code I have so far:

import java.util.Random;

public class Trial
{
public Random RNG;
public float time;
public float transfer;

public Trial()
{
RNG = new Random();
transfer = 96000;
}

public void GenerateData()
{
for(int i = 1; i < 101; i++){
int GenerateComputer = RNG.nextInt(4);
long DataSize = RNG.nextInt(1536001);
System.out.println("-Computer " + (GenerateComputer + 1) + " sends " + (DataSize * 10) + " bits of data.");
time = ((DataSize * 10) / (transfer));
System.out.println("The total time to transfer the file took " + time + " seconds at 96k/sec.");
System.out.println("===================================================================");
}
}

}
12 years ago
Ok I am having trouble with an assignment I am doing for my class.
The Assignment is as follows:

Compare the performance of a 4-computer network in the following situations:

- First Come First Serve (the first computer to have a message available gets complete control of the network until transmission is done).

- The network uses Time Division Multiplexing with computers taking turns with one packet (10 Kb) being sent every time.

- The same as the situation before except that computers with nothing to send forfeit their turns.

Turn in a report (with a cover page) comparing the performance of the network in all 3 situations. Also turn in any code used to generate the report or create the simulation. Calculate the average wait time for all messages.

Rules:

- In each of the three situations 100 random-sized messages need to be sent. The size will vary between 10 K and 15 MB (in increments of 10 K).

- The transfer rate is 96 K/ sec.

The part I am have trouble with is step two: - The network uses Time Division Multiplexing with computers taking turns with one packet (10 Kb) being sent every time.

I can not figure out how to divide it up sending 10Kb at a time, and then giving the total time to send all four messages. Anyone able to help me out?

This is the code I have so far:

import java.util.Random;

public class Trial
{
public Random RNG;
public float time;
public float transfer;

public Trial()
{
RNG = new Random();
transfer = 96000;
}

public void GenerateData()
{
for(int i = 1; i < 101; i++){
int GenerateComputer = RNG.nextInt(4);
long DataSize = RNG.nextInt(1536001);
System.out.println("-Computer " + (GenerateComputer + 1) + " sends " + (DataSize * 10) + " bits of data.");
time = ((DataSize * 10) / (transfer));
System.out.println("The total time to transfer the file took " + time + " seconds at 96k/sec.");
System.out.println("===================================================================");
}
}

}
12 years ago
But the thing is that I don't know how to write it. He is the type that as long as we can find a solution he doesn't care where we get it from.
12 years ago
It is an entry level computer programming class using Java, but our teacher apparently thinks we understand more complex/difficult things than we actually do. I just really need a good grade in this class, which is why i am trying so hard to find a solution, the problem is finding one, once i find one, i can generally figure it out myself and understand it, but the problem is getting to that point.
12 years ago
i dont have anything on this one yet, i have spent so much time getting the others together, and this is my last one. which is why i turned to my last resort, online forums. I understand the concept behind it, i just dont understand how to write the actual code, like i know i will probably have to use a loop, having every 4th year add and extra day because of leap years, and then the whole JDate and GDate thing, but other than that, I am stumped.
12 years ago
actually it is in preparation for a test, and he said there would be something like that on the test, so i am trying to figure out how to do it. i dont have a very good teacher, because he teaches us practically nothing. I basically just need this for reference purposes.
12 years ago
I need to know how to prompt the user for their birth date and calculate and display how many days old they are. Can anyone help me out, because i am completely stuck, thanks in advance
12 years ago
I need to know how to prompt the user for their birth date and calculate and display how many days old they are. Can anyone help me out, because i am completely stuck, thanks in advance
12 years ago