Skip to main content

Posts

Showing posts from March 14, 2012

First Android Project

  You need to install the Android SDK and developer tools.Once you have the Android SDK, it istime to make your first Android project. The good news is that this requires zero lines of code – Android's tools create a "Hello, world!" application for you as part of creating a new project. All you need to do is build it, install it, and see it come up on your emulator or device. Step #1: Create the New Project Android's tools can create a complete skeleton project for you, with everything you need for a complete Android application. Step #1: Eclipse From the Eclipse main menu, choose File | New | Project..., and this will bring up a list of project types to choose from. Fold open the Android option and click on Android Project: Press Next to advance the wizard to the main Android project page: Fill in the following: • The name of the project (e.g., Now) • The Android SDK you wish to compile against (e.g., Google APIs for Android 2.3) • The name of the Java package

WAP FIND OUT SECOND LARGEST NUMBER IN AN UNSORTED ARRAY USING C LANGUAGE

#include<stdio.h> #include<conio.h> void main() { int a[5],i,j=0,big,secondbig; printf(" Enter 5 elements in to the array:); for (i=0;i<=4;i++) scanf(" %d ",&a[i]); big=a[0]; for (i=1;i<5;i++){ if (big<a[i]){ big=a[i]; j = i; } } secondbig=a[5-j-1]; for (i=1;i<5;i++){ if (secondbig <a[i] && j != i) secondbig =a[i]; } printf(" Second biggest Number: %d ", secondbig); return 0; }

WAP TO FIND OUT LARGEST NUMBER IN AN ARRAY USING C LANGUAGE

#include<stdio.h> #include<conio.h> void main() { int a[50],size,i,big; printf(" \nEnter the size of the array: "); scanf(" %d ",&size); printf(" \nEnter %d elements in to the array: ”, size); for (i=0;i<size;i++) scanf(" %d ",&a[i]); big=a[0]; for (i=1;i<size;i++){ if (big<a[i]) big=a[i]; } printf(" \nBiggest Number: %d ",big); getch(); }

INHERITANCE IN C++

Inheritance: It is the capability of one class to inherit properties from another class. Base Class: It is the class whose properties are inherited by another class. It is also called Super Class. Derived Class: It is the class that inherit properties from base class(es).It is also called Sub Class. TYPES OF INHERITANCE Single Inheritance: It is the inheritance hierarchy wherein one derived class inherits from one base class. Multiple Inheritance: It is the inheritance hierarchy wherein one derived class inherits from multiple base class(es) Hierarchical Inheritance: It is the inheritance hierarchy wherein multiple subclasses inherits from one base class. Multilevel Inheritance: It is the inheritance hierarchy wherein subclass acts as a base class for other classes. Hybrid Inheritance: The inheritance hierarchy that reflects any legal combination of other four types of inheritance. Visibility Mode: It is the keyword that controls the visibility and avai

CONSTRUCTOR AND DESTRUCTOR in C++

CONSTURCTOR It is a member function having same name as it’s class and which is used to initialize the objects of that class type with a legel initial value. Constructor is automatically called when object is created. Types of Constructor Default Constructor- : A constructor that accepts no parameters is known as default constructor. If no constructor is defined then the compiler supplies a default constructor. student :: student() {      rollno=0;      marks=0.0; } Parameterized Constructor - : A constructor that receives arguments/parameters, is called parameterized constructor. student :: student(int r) {      rollno=r; } Copy Constructor- : A constructor that initializes an object using values of another object passed to it as parameter, is called copy constructor. It creates the copy of the passed object. student :: student(student &t) {      rollno = t.rollno; } DESTRUCTOR A destructor is a member function having sane name as that of its class preceded by ~(tilde) sig