Fresh Information, Great Ideas, Latest Product Review & Specification » Computer & Gadget

Fresh Information, Great Ideas, Latest Product Review & Specification » Home and Appliances

Fresh Information, Great Ideas, Latest Product Review & Specification » Camera & Photography

Friday, July 9, 2010

java loop

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.*;
public class activity
{
public static void main( String[] args ) throws IOException {
BufferedReader dataIn = new BufferedReader(new
InputStreamReader( System.in) );
int fnum;
int lnum;

System.out.println("Enter first number:");
System.out.flush();
fnum = Integer.parseInt( dataIn.readLine());


if (fnum != fnum){
}

System.out.print ("Enter last number : ");
System.out.flush();
lnum = Integer.parseInt( dataIn.readLine());

if (fnum > lnum){
System.out.print("Cannot allow to make a loop!");
System.exit(1);
}



if (fnum == fnum){
while (fnum <= lnum){
System.out.println(fnum);
fnum++;
}
}

else{
System.out.print("Cannot allow to make a loop");
}





}
}

Tuesday, July 6, 2010

Sound/Audio

Objectives:

1. To understand how computers process sound.

2. To understand how computers synthesize
sound.

3. To understand the differences between two
major kinds of audio, namely digitized sound
and MIDI music

The Nature of Sound

Sound is a physical phenomenon produced by the vibration of matter and transmitted as waves.

However, the perception of sound by human beings is a very complex process. It involves three systems:

1. SOURCE which emits sound;

2.MEDIUM through which the sound propagates;

3.DETECTOR which receives and interprets the sound.


Sound waves can be characterized by the following attributes:

Period
Frequency
Pitch
Amplitude
Loudness
Bandwidth
Dynamic

Pitch and Frequency

Period - is the interval at which a periodic signal repeats regularly.

Pitch - is a perception of sound by human beings It measures how ‘high’ is the sound as it is perceived by a listener.

Frequency - measures a physical property of a wave.

Musical instruments are tuned to produce a set of
fixed pitches

Loudness and Amplitude
The other important perceptual quality is loudness or volume.

Amplitude is the measure of sound levels.

Typical sound levels generated by various sources

160 dB Jet engine
130 dB Large orchestra at fortissimo
100 dB Car on highway
70 dB Voice conversation
50 dB Quiet residential areas
30 dB Very soft whisper
20 dB Sound studio

Dynamic and Bandwidth

Dynamic range - means the change in sound levels.
For example, a large orchestra can reach 130dB at its climax and drop to as low as 30dB at its softest, giving a range of 100dB.

Bandwidth - is the range of frequencies a device can produce or a human can hear.

Bandwidth

FM radio 50Hz – 15kHz
AM radio 80Hz – 5kHz
CD player 20Hz – 20kHz
Sound Blaster 16 sound card 30Hz – 20kHz
Inexpensive microphone 80Hz – 12kHz
Telephone 300Hz – 3kHz
Children’s ears 20Hz – 20kHz
Older ears 50Hz – 10kHz
Male voice 120Hz – 7kHz
Female voice 200Hz – 9kHz

Sunday, July 4, 2010

C# PROGRAM DETERMINE LEAP YEAR


using System;

namespace leapyear
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Enter a year");
string a = Console.ReadLine();
// int a = int.Parse(a);
if (a.Length==4)
{
int b = int.Parse(a);
if((b%4)==0)
{
Console.WriteLine("Leap Year");
}
else
{
Console.WriteLine("Not a Leapyear");
}
}
Console.Write("Press any key to continue . . . ");
Console.ReadKey(true);
}
}
}