Questions
Two Systems 80 Km apart are communicating through a direct Metallic cable (note: signal speed is...

Two Systems 80 Km apart are communicating through a direct Metallic cable (note: signal speed is 2 x 10^8 m/s). The data is in the form of 60 KB packets with transmission rate 1M bps. Calculate the following:

  1. Data transmission time per packet.
  2. Propagation delay.
  3. bit duration.
  4. Bit length.
  5. Number of bits in the cable between the sender and receiver.

In: Computer Science

Use JAVA to Design a simple registration system that allows Student to register in a course....

Use JAVA to Design a simple registration system that allows Student to register in a course.

Requirements

  • using 2 classes: class Student & class Course.
  • Implement the scenarios in class Test’s main method.
  • Each student has a name and an id variable.
  • Each object of class Student is initialized using values of name and id passed to constructor.
  • Class Student has get methods for its instance variables.(getters and setters)
  • Each Course has a name, and a variable numberOfStudent representing the number of registered students.
  • A course can have a maximum number of 10 students registered in it.
  • Class Course store the registered students in students which is an array of type Student. When a student register in a course, he is added to the array. Each object of class Course is initialized using the title(name).
  • Class Course has the following methods:
    • method getStudents(): return the array of registered students;
    • method boolean isFull(): return true if the course is full,
    • get method for the name and numberOfStudent field;
    • method registerStudent (Student student): if the course is not full, register a student in course.

In: Computer Science

Write a program that takes an integer as input and returns whether it is a prime...

  1. Write a program that takes an integer as input and returns whether it is a prime number or not in C++. (Using if, loops, or/and bool only)

In: Computer Science

  Question no 3: USE PYTHON a. Generate a discrete uniform distribution of population size 100 between...

  Question no 3: USE PYTHON

a. Generate a discrete uniform distribution of population size 100 between interval (1,10).)

b Consider the sample size of N=10, Simulate the sampling distribution of the sample mean. (repeat 100 times)

c Consider the sample size of N=30, what is the sample mean and sample standard deviation? (repeat 100 times)

In: Computer Science

Please Use the ECLIPSE AND FOLLOW THESE RULES Apply the naming conventions for variables, methods, classes,...

Please Use the ECLIPSE AND FOLLOW THESE RULES

Apply the naming conventions for variables, methods, classes, and packages:

- variable names start with a lowercase character

- classes start with an uppercase character

- packages use only lowercase characters

methods start with a lowercase character

question1:

Design a Lotto class with one array instance variable to hold three random integer values (from 1 to 9). Include a constructor that randomly populates the array for a lotto object. Also, include a method in the class to return the array.

Use this class to simulate a simple lotto game in which the user chooses a number between 3 and 27. The user runs the lotto up to 5 times and each time the sum of lotto numbers is calculated. If the number chosen by the user matches the sum, the user wins and the game ends. If the number does not match the sum within five rolls, the computer wins.

question2:

Write a Java class that implements a set of three overloaded static methods. The methods should have different set of parameters and perform similar functionalities. Call the methods within main method and display the results.

eclipse...

In: Computer Science

Provide pseudo-code to compute the difference of two sets, S - T, using: a. sets represented...

Provide pseudo-code to compute the difference of two sets, S - T, using:

a. sets represented by linked-lists of characters.

b. sets represented by bit strings. (hint - what is "exclusive or?")

In: Computer Science

Is there a way to limit the # of times an Excel file can be opened?...

Is there a way to limit the # of times an Excel file can be opened? The solution would also require that the Excel file could not be copied to another location to bypass the counter.

In: Computer Science

Explain how a read I/O operation happens in 2 scenarios: with DMA and without DMA. Clearly...

Explain how a read I/O operation happens in 2 scenarios: with DMA and without DMA. Clearly explain how the I/O device and the CPU works concurrently in both cases. Explain through an example showing the steps of the protocols and the algorithms underneath.

In: Computer Science

PLEASE Use the ECLIPSE... AND FOLLOW THIS RULES.. Apply the naming conventions for variables, methods, classes,...

PLEASE Use the ECLIPSE...

AND FOLLOW THIS RULES..

Apply the naming conventions for variables, methods, classes, and packages:

- variable names start with a lowercase character

- classes start with an uppercase character

- packages use only lowercase characters

methods start with a lowercase character

Write a Java application that simulates a test. The test contains at least five questions about first three lectures of this course. Each question should be a multiple-choice question with 4 options.

Design a Test class. Use programmer-defined methods to implement your solution. For example:

  • create a method to simulate the questions – simulateQuestion
  • create a method to check the answer – checkAnswer
  • create a method to display a random message for the user – generateMessage
  • create a method to interact with the user - inputAnswer

For each question:

  • If the user finds the right answer, display a random congratulatory message (“Excellent!”,”Good!”,”Keep up the good work!”, or “Nice work!”).
  • If the user responds incorrectly, display an appropriate message and the correct answer (“No. Please try again”, “Wrong. Try once more”, “Don't give up!”, “No. Keep trying..”).
  • Use random-number generation to choose a number from 1 to 4 that will be used to select an appropriate response to each answer.
  • Use a switch statement to issue the responses, as in the following code:

switch ( randomObject.nextInt( 4 ) )

{

case 0:

return( "Very good!" );

……

}

At the end of the test display the number of correct and incorrect answers, and the percentage of the correct answers.

Your main class will simply create a Test object and start the test by calling input answer method.

Thank you.

In: Computer Science

Algorithm. We divide each of the matrices A and B into 9 submatrices with size n/3...

Algorithm. We divide each of the matrices A and B into 9 submatrices with size n/3 × n/3 each. The matrix C = A × B is obtained by using 25 multiplications and 30 additions of the submatrices. What is the recursive formula of the running time function T(n) of this algorithm? What is the running time of this algorithm (in Θ notation)?

In: Computer Science

System.out.println("Enter a temperature in Fahrenheit: ");          double fahrenheit = input.nextDouble();       double...

System.out.println("Enter a temperature in Fahrenheit: ");
     
   double fahrenheit = input.nextDouble();
  
   double celsius = (5.0 / 9) * (fahrenheit - 32);
   System.out.println("Fahrenheit " + fahrenheit + " is " + celsius + " in Celsius");

the above code i would like to print to 2 decimal places for celsius please  

this is in JAVA

In: Computer Science

in Java, I need to create an array of animals. The user is going to be...

in Java, I need to create an array of animals. The user is going to be prompted to enter the size of the array where a valid size is 10-30(inclusive). Then I have to populate only half of this array. I am not sure how to do that so can you please write comments explaining.

Thank you

In: Computer Science

Identify all private and shared variables in the following code snippet. What is the output of...

Identify all private and shared variables in the following code snippet. What is the output of the program (e.g. the value of res)?

// =========

int A[100];

int count;

void work(int index[])

{

float B[10];

……

}

void main(){

int res = 10;

#pragma omp parallel  

{

int index[10], i=0, IS=0;

                        work(index);

                        #pragma omp for

                        for(i=0;i<100;i++)

                        {

IS = IS + i;

                        }

#pragma omp critical

res += IS;

}

cout << res << endl;

}

View keyboard shortcuts

In: Computer Science

I want answers of the following questions My lab assingment: its a program written in netbean...

I want answers of the following questions

My lab assingment:

its a program written in netbean ide 8.2

My topic: Bank Account

Program code:

class Account{
int acc_no;
String name;
float amount;
void insert(int a,String n,float amt){
acc_no=a;
name=n;
amount=amt;
}
void deposit(float amt){
amount=amount+amt;
System.out.println(amt+" deposited");
}
void withdraw(float amt){
if(amount<amt){
System.out.println("Insufficient Balance");
}else{
amount=amount-amt;
System.out.println(amt+" withdrawn");
}
}
void checkBalance(){System.out.println("Balance is: "+amount);}
void display(){System.out.println(acc_no+" "+name+" "+amount);}
}

class TestAccount{
public static void main(String[] args){
Account a1=new Account();
a1.insert(832345,"Ali",1000);
a1.display();
a1.checkBalance();
a1.deposit(40000);
a1.checkBalance();
a1.withdraw(15000);
a1.checkBalance();
}}


Task: Each one of you was given a Lab assignment of choosing a real world object to be represented as a programming object and writing a class code for that object. You have been asked to mimic at least 3 states and 3 behaviors of that object.

Your theory assignment is to provide the detail analysis on your part while you selected and mimic that object in programing language. You are to provide brief insight and analysis you have done in each the following:

1. What was your inspiration to choose that object?

2. Which 3 states you choose and why?

3. Do all the behaviors correspond directly to your states or not?

4. What were the challenges you faced with selecting the object?

5. If you were to asked to choose another object, which object will you choose and why?

In: Computer Science

The client needs this program written in Java. Your team is tasked to create a program...

The client needs this program written in Java. Your team is tasked to create a program that converts Fahrenheit to Celsius. Fahrenheit temperature of 87.6 degrees. Convert it to Celsius, and display the temperature in both units. Your output should look similar to the following:

Fahrenheit Temperature: 87.6
Celsius Temperature: 30.88

In: Computer Science