Thursday, 27 October 2016

Example of reading data through Scanner Class

         USING SCANNER CLASS TO INPUT 


BY USING THIS CLASS WE CAN DIRECTLY CONNECT WITH KEYBOARD. THE MAIN ADVANTAGE OF USING THIS CLASS IS TO READ NUMERIC TYPES OF DATA WITHOUT CONVERTING IT. IT IS AVAILABLE IN java.util PACKAGE. THIS CLASS HAS THE FOLLOWING METHODS :

next( ), nextLine( ), nextByte( ), nextShort( ), nextInt( ),nextFloat( ), nextDouble( ) etc.



Example of using Scanner to a normal results of student program:

   

import java.io.PrintStream;
import java.util.Scanner;
class Program                                         // Program is a Class word and 'P' should be in capital form
{
public static void main(String args[])
{
PrintStream ps = new PrintStream(System.out);
Scanner sc = new Scanner(System.in);
int sno,em,tm,hm,mm,scm,som,tot;
float avg;
String sname,res;
ps.println("Enter Student Number and Name");
sno = sc.nextInt( );
sname = sc.next( );
ps.println("Enter English, Telugu and Hindi Marks");
em = sc.nextInt( );
tm = sc.nextInt( );
hm = sc.nextInt( );
ps.println("Enter Maths, Science and Social Marks");
mm = sc.nextInt( );
scm = sc.nextInt( );
som = sc.nextInt( );
tot = em + tm + hm + mm + scm + som;
avg = tot / 6.0F;
if(em >= 34 && tm >= 34 && hm >= 34 && mm >= 34 && scm >= 34 && som >= 34 && avg >= 80)
{
res = "Distinction";
}
else
if(em >= 34 && tm >= 34 && hm >= 34 && mm >= 34 && scm >= 34 && som >= 34 && avg >= 60)
{
res = "First Class";
}
else
if(em >= 34 && tm >= 34 && hm >= 34 && mm >= 34 && scm >= 34 && som >= 34 && avg >= 50)
{
res = "Second Class";
}
else
if(em >= 34 && tm >= 34 && hm >= 34 && mm >= 34 && scm >= 34 && som >= 34 && avg >= 40)
{
res = "Third Class";
}
else
if(em >= 34 && tm >= 34 && hm >= 34 && mm >= 34 && scm >= 34 && som >= 34 && avg >= 34)
{
res = "Ordinary Pass";
}
else
{
res = "Fail";
}
ps.println("\t\t Abc School");
ps.println("\t\t=================");
ps.println("Student Number : " + sno);
ps.println("Student Name : " + sname);
ps.println("Total Marks : " + tot);
ps.printf("Average Marks : %.3f\n",avg);
ps.print("Result : " + res);
}
}


RESULT:

Enter Student Number and Name
2
JOHN
Enter English, Telugu and Hindi Marks
60
70
87

Enter Maths, Science and Social Marks
90
87
75
Abc School
        =================
Student Number : 2
Student Name : JOHN
Total Marks : 469
Average Marks : 78.167
Result : First Class

Wednesday, 19 October 2016

Inheritance topic

INHERITANCE IN JAVA



INHERITANCE IS THE TECHNIQUE OF EXTENSION OF ALREADY EXISTING CLASS. IT MEANS WE CAN PRODUCE NEW CLASS FROM EXISTING CLASS . IN THIS PROCESS, EXISTING CLASS IS CALLED AS SUPER CLASS / BASE CLASS  AND THE EXTENDED CLASS IS CALLED AS SUB CLASS / DERIVED CLASS / NEW CLASS. SUB CLASS IS 
POWERFUL THAN SUPER CLASS, BECAUSE SUB CLASS HAVE ALL THE FEATURES OF SUPER CLASS AND ADDITIONAL FEATURES OF ITSELF. THE MAIN ADVANTAGE OF INHERITANCE IS REUSABILITY OF CODE. IF WE CREATE AN OBJECT TO SUB CLASS IT CONTAINS A COPY OF SUPER CLASS OBJECT. THAT IS THE REASON WHY SUPER CLASS MEMBERS ARE AVAILABLE TO SUB CLASS. GENERALLY WE DON'T CREATE AN OBJECT TO SUPER CLASS IN INHERITANCE. SO BETTER WAY IS CREATE OBJECT TO SUB CLASS NOT TO SUPER CLASS.
           TYPES OF INHERITANCE
           ======================

            1) SINGLE INHERITANCE

            2) MULTI LEVEL INHERITANCE

            3) HIERARCHICAL INHERITANCE

            4) MULTIPLE INHERITANCE

            5) HYBRID INHERITANCE

JAVA'S RULE IS THAT A CLASS CAN HAVE ONLY ONE SUPER CLASS. SO JAVA DOES NOT SUPPORT MULTIPLE, MULTI PATH AND HYBRID INHERITANCES DIRECTLY.

1)    SINGLE INHERITANCE
   
       DERIVING NEW CLASS FROM SINGLE CLASS.
2)    MULTILEVEL INHERITANCE
     
       DERIVING NEW CLASS FROM ANOTHER DERIVED CLASS.
3)   HIERARCHICAL INHERITANCE

      THIS TYPE OF INHERITANCE IS SIMILAR TO A TREE. IN THIS MODEL EACH SUPER         CLASS HAS MINIMUM TWO SUB CLASSES. GENERALLY IN THIS MODEL OBJECTS           ARE CREATED FROM LEAF NODE (LAST SUB) CLASSES.

          MULTIPLE INHERITANCE  & HYBRID ARE NOT PREFERED.


Monday, 15 June 2015

About GROOMING


                       


It means to care for the appearance of.
Grooming includes personal grooming & staff grooming also.
In Staff grooming all people irrespective of the fact that they have direct or indirect contact with guests should be well groomed, so that everyone should have a good impression on guests. While coming to personal view:
HAIR:
           It should be clean, neatly cut and not extending below ears. Also it should be on or above collar line.
       Ø  Should be well combed. 
       Ø  It should be frequently shampooed but not oily.
FACE:
       Ø  Face should be cleanly shaved. No moustache.
       Ø  Teeth must be well brushed. There should be no marks of nicotine stains. 
       Ø  Sideburns are not to be much longer than half of length of ear.
HANDS:
       Ø  Nails must be clean and well trimmed.
       Ø  No stains or marks should be there on nails.
SHOES:
       Ø  Shoes must be well repaired and should not make sounds.
       Ø  They should be cleaned well and socks must be clean.
While coming to personal hygiene:
 Ø  We should bath daily and could use a deodorant. Also can use mouth freshener for fresh breathe. 
 Ø  We should not use gutka. Also well dressed for a nice look.
 Ø  We should not do like picking teeth, nose. Sneezing or yawing without mouth closing.

                     REPLY YOUR COMMENTS AND SUGGESTIONS

Thursday, 28 August 2014

SOLAR COOKER



SOLAR COOKERS

One of the Applications of solar energy:



      The solar vessel consists of an outer box made of either fiber glass or aluminum sheet. Blackened aluminum, double glass lid, a reflector, insulator and cooking pots. Blackened aluminum tray is fixed inside the box and sides are covered with an insulating material to prevent heat losses. A reflecting mirror is provided on the box cover increases the solar energy input. Metallic cooking parts are painted black on outer side, food to be cooked is placed in cooking parts &cooker is kept facing the sun to cook the food. An electric heater may also be used as a generator to serve as a back up during non sun shine hours.

Tuesday, 5 August 2014


 Rating of power diode can be increased by :


 Rating of power diode can be increased by introducing a drift layer in the diode between p and n sides. Where p and n side are heavily doped and drift layer (n-) is lightly doped. During reverse bias condition because of this doping difference more depletion layer is formed. Because p+ (holes) are heavily doped and can form small space of depletion layer, while during n-  side due to lightly doped it forms a free region. So that depletion region increases. So depletion region is more in n- side. Any  signal device can be converted to high power device.  By using same method, first we should identify the region  which blocks  voltages and then add a lightly doped layer on one of it’s side. (i.e., a junction which forms between heavily and lightly doped layers can block the high voltages. So by increase in the width of depletion region the drift layer increases, by increase in drift layer rating of power semi conductors are increased.

Friday, 1 August 2014

MACHINE ARMATURE


ADVANTAGES OF STATIONARY ARMATURE OVER ROTATING ARMATURE:




The various advantages of rotating field (i.e field flux) are as follows:
1)A.c. is used everywhere, the generation level of a.c. voltage may be higher as 11 KV to 33 KV or even more. This gets induced in the armature. For stationary armature large space can be provided to accommodate large number of conductors and the insulation's.
2) It is always better to protect high voltage winding from the centrifugal forces caused due to the rotation. So high voltage armature is generally kept stationary. This avoids the interaction of mechanical and electrical stresses.
3) It is very easy to collect larger currents at very high voltage if the armature winding is stationary so that any slip rings and brushes can not come in to picture. The voltage required to be supplied to the field is very low ( 230 V d.c.) and hence can be easily supplied with the help of slip ring and brush assembly by keeping it rotating.
4) The problem of sparking at the slip rings can be avoided by keeping field rotating which is low voltage circuit and high voltage armature as stationary.
5) Due to low voltage level on the field side (i.e., rotor side) the insulation required is less and hence field system has very low inertia. Due to less winding heat liberated will be there and his can be cooled quickly when compared to armature winding in rotor side.
6) If field is rotating, to excite it  external d.c. supply two slip rings are enough. Once each for positive and negative terminals. As against this, in three phase rotating armature the minimum number of slip rings required are three and can not be easily insulated due to high voltage levels.
7) The ventilation arrangement for high voltage side can be improved if it is kept stationary.
       Due to all these reasons the most of the alternators in practice are using rotating field type (stationary armature winding) of arrangement. For small voltage rating alternators rotating armature arranged may be used.

                                          REPLY IF ANY SUGGESTIONS