Computer Science Questions and Answers



Recent Questions :: Computer Science

5002 QuestionsPage 1 of 501.

Find the Number of Page Faults

If FIFO page replacement is used with four-page "frames and eight pages, how many page faults will occur with the reference string 0 1 72327103 if the four frames are initially empty?
Repeat this process for LRF

Asked by: Prantar Bhattacharjya on Dec 28, 2020.EDIT

Find the Number of Subnets

Given the IP address of 172.16.1.1 with a mask of 255.255.255.0. How many total subnets could be created? (Assume all subnets use the same subnet mask)

Asked by: Rusty on Nov 19, 2020.EDIT

Find the Class of IP Address 172.16.33.1/24

What address Class does 172.16.33.1/24 belong to?

Asked by: Rusty on Nov 19, 2020.EDIT

C Program for Employee Salary Details

Write a c programme that accepts the salary and age from the user and displays the same on the screen as output.

Asked by: Hassan on Nov 4, 2020.  Answers (1)

Technical : Predict the Output of the Given Code

Please explain the code and predict the output:

import numpy as np
import matplotlib.pyplot as plt
from scipy import signal

"""
parameters:
rhp - spectral noise density unit/SQRT(Hz)
sr - sample rate
n - no of points
mu - mean value, optional

returns:
n points of noise signal with spectral noise density of rho
"""
def white_noise(rho, sr, n, mu=0):
sigma = rho * np.sqrt(sr/2)
noise = np.random.normal(mu, sigma, n)
return noise

rho = 1
sr = 1000
n = 1000
period = n/sr
time = np.linspace(0, period, n)
signal_pure = 100*np.sin(2*np.pi*13*time)
noise = white_noise(rho, sr, n)
signal_with_noise = signal_pure + noise

f, psd = signal.periodogram(signal_with_noise, sr)

print("Mean spectral noise density = ",np.sqrt(np.mean(psd[50:])), "arb.u/SQRT(Hz)")

plt.plot(time, signal_with_noise)
plt.plot(time, signal_pure)
plt.xlabel("time (s)")
plt.ylabel("signal (arb.u.)")
plt.show()

plt.semilogy(f[1:], np.sqrt(psd[1:]))
plt.xlabel("frequency (Hz)")
plt.ylabel("psd (arb.u./SQRT(Hz))")
#plt.axvline(13, ls="dashed", color="g")
plt.axhline(rho, ls="dashed", color="r")
plt.show()

Asked by: Saranya on Oct 30, 2020.

Create a Database for a City

Implement a city database, each database record contains the name of the city (a string of arbitrary length) and the coordinates of the city expressed as integer x and y coordinates. Your database should allow records to be inserted, deleted by name or coordinate, and searched by name or coordinate. Another operation that should be supported is to print all records within a given distance of a specified point (capital city).

Asked by: Suryajith on Oct 27, 2020.

Uses of The Floppy Disk

What are the uses of the floppy disk?

Asked by: Abubakar Sadiq Umar on Oct 15, 2020.

Number of Arguments Passed in an Applet

How many arguments to be passed to an applet using pram tag?

Asked by: Ranjeet Kumar on Sep 29, 2020.

Choose the Answer: Information Retrieval

Information retrieval is faster from?

A) Floppy disk
B) Magnetic tape
C) Hard disc
D) All of these.

Asked by: Mahmud Ullah on Sep 27, 2020.

Subnet to the Given Address

A newly formed company in Kenya has obtained a subnetted public IP address 200.0.0.128 255.255.255.128 from Kenya Domain Registrar (KENIC). The company has three branches with (20), (12 users) and (5 users) respectively. Showing your work, subnet to address the given scenario.

Asked by: Wanjiru on Sep 25, 2020.

Sponsored Links


Current Affairs

Quick Links