Saturday, 6 July 2013

New Windows 7 tips

New Windows 7 tips

Windows 7 keyboard shortcuts
Use the below Windows 7 keyboard shortcuts to make the most of your Windows 7 experience.
Windows key and the arrow keys
Pressing the Windows key and Left or Right arrow keys will dock the window your viewing to the left or right-hand side of the screen. Pressing the Windows key and the Up arrow will maximize a window and pressing the Windows key and the Down arrow will resize and then minimize the window.
Use Shift: To stretch a window vertically, press the Windows key + Shift + the Up arrow. If you have multiple monitors use the Windows key + Shift + the Left or Right arrow keys to move the window to another monitor.
Windows key and plus and minus keys
If you ever need to zoom in or out of what is being displayed on your screen press the Windows key and the + (plus) or - (minus) keys. Pressing the plus zooms in and once zoomed in the minus will zoom out.
Clear all background programs
If you are not viewing a window in full screen and have other windows open in the background clear all background open windows by pressing the Windows key + the Home key.

Find and run anything in Windows by using the Windows 7 search box. Click the Start orb or press then Windows key and type the name of the program you wish to run or file you wish to edit. Windows 7 will usually do a good job at finding an exact match and simply pressing enter will execute that program or open that file. If more than one match is found, use the up and down arrow keys to select the file you wish to open and then press Enter.Use the Windows 7 search
Windows 7 search box
Running as administrator: Some programs may require administrator mode in order to function properly. You can run any program as administrator from the search box by typing the name of the program you want to run and then instead of pressing Enter to run the program press Ctrl+Shift+Enter to run as administrator. If you want to click and run a program as administrator hold down the Ctrl+Shift and then click the icon.
Take full advantage of the Taskbar
Pin programs to the Taskbar
All programs can be pinned to the Taskbar and allow easy access to your favorite programs without having to use the Start Menu. To Pin a program to the Taskbar right-clickon the program or shortcut to the program and in the menu choose the Pin to Taskbar option. Alternatively you can also drag the icon to the Taskbar.
If you want to remove a pinned program, right-click on the Taskbar icon and click Unpin this program from the Taskbar. Alternatively you can also drag the icon off of the task bar and then click Unpin this program from the Taskbar.
Move the icons and pinned programs
Any pinned or opened program on the Taskbar can be moved and arranged. Left-click on any icon on the Taskbar and drag it to the location you want it to remain.
Windows key and a number
Pressing the Windows key and a number on the top row of your keyboard will open the Window corresponding to the open program on your Taskbar. For example, in the below picture of the Windows 7 Taskbar, Firefox i the first icon, Control panel is the second icon, and Adobe Photoshop is the third icon. If the Windows key + 3 was pressed, Adobe Photoshop would become the active window. To make it even easier arrange your icons (as mentioned above) from left to right by most frequently opened.
Windows 7 Taskbar
Pin your favorite folder
If you frequently access the same folder (e.g. your favorites, my documents, Dropbox, etc.) pin the folder to the Windows Explorer icon on the Taskbar. To do this drag your favorite folder to the Taskbar until you see Pin to Windows Explorer. Once pinned, right-click the Explorer icon to access that folder under the Pinned section.
Open a second instance
If you want to open a second instance or window of a program that is already open, press and hold the Shift key and then click the program icon on the Taskbar.
Get to the Desktop
Click the Desktop button on the far right edge of the Taskbar to get to the Desktop.
Windows 7 notification area aka systrayCustomize the Notification area
Windows Vista and Windows 7 allow the Windows Notification area (aka Systray) to be modified. By default, many of the icons shown in the past are now hidden and give Windows a much cleaner look. Customize this area to make icons show or not show by clicking on the up arrow next to the icons and selecting Customize, as shown in the picture to the right. Once in Customize you can choose what programs show, don't show, or only show notifications.
Improve the quality of your text
Use the Windows ClearType Text Tuner to improve the overall quality of all text you read on your screen. To start the ClearType Text Tuner click the Start Orb and type cttune.exe and press Enter.
Enable and disable Windows 7 features
Turn on and off Windows features by clicking Start, typing features and press enter. In the Programs and Features window on the left-hand column click Turn Windows features on or off and in the Windows Features box check or uncheck the features you want enabled or disabled.
Use the Reliability and Performance Monitor
View the reliability history of your computer by using the Reliability Monitor. Click the Start orb and type reliability and press enter for View Reliability History. In the Reliability Monitor, you'll be able to view the overall reliability of your computer and be able to identify any past problems your computer has had.
If you want to view the performance of your computer in real time use the Performance Monitor. Click the Start orb and type performance and press enter for the Performance Monitor. In the Performance Monitor, you can view your computers performance in real time or view a log of your systems performance.
Re-enable underlined keyboard shortcuts
File menu underlined shortcutsBy default, Windows 7 has the underlines for keyboard shortcuts like those shown in the picture to the right disabled. To re-enable these underlines in all Windows programs follow the below steps.
  1. Open the Control Panel
  2. In the Control Panel click Ease of Access
  3. In Ease of Access click Change how your keyboard works
  4. Finally, check the Underline keyboard shortcuts and access keys and then click Ok.
Rename multiple files at once
To change the name of multiple files at once highlight all the files you wish to rename in Windows Explorer and press the F2 key. Type in the new name you wish to use for all files and press enter. Once done all files will be renamed to the name entered followed by a unique number.
Install Windows Essentials
Install missing Windows software by installing the free Windows Essentials software package that includes: Windows Live Family Safety, Windows Live Mail, Windows Live Messenger, SkyDrive for Windows, Windows Movie Maker, Windows Photo Gallery, Windows Live Writer, and Microsoft Outlook Hotmail Connector.
  • Official Windows Essentials web page and download.

New Windows 8 Tricks

Top 10 Windows 8 tips and tricks

Customize your tiles
Windows 8 tilesMake the most of your Windows Start screen tiles by adjusting the sizes, where they are located, and what is listed.
  • Move any tile by clicking and dragging the tile. While moving a tile, if you need a larger view of the Start screen move the tile towards the top or bottom of the screen to zoom out.
  • Use your mouse wheel to scroll left-to-right through your tiles.
  • Any Desktop shortcut or program can be pinned to the Start screen by right-clicking the icon and choosing Pin to Start.
  • In the bottom right-hand corner of the start screen is a magnifying glass with tiles, click this icon to get a zoomed out view of your Start screen. In this view, if you right-click on a group of tiles you'll be given the option to name group, which can be useful if you have a group of related tiles (e.g. games). In this view, you can also click and drag a group to organize your tile groups.
  • Create a new speed bump between tile groups by moving a tile to a speed bump.
  • Resize any User tile or Live tile by right-clicking the tile and choosing resize.
  • If there is a tile you want on your Taskbar, right-click the tile and choose Pin to taskbar.
  • Show admin applications on the Start screen by clicking Settings in Charms, click Settings, and change the Show administrative tools from No to Yes.
  • In Internet Explorer 10, you can also pin any of your favorite web pages to your Start Screen.
Windows 8 keyboard shortcuts
Knowing at least some of the Windows 8 keyboard shortcuts will make your Windows 8 experience much more enjoyable. Try to memorize these top Windows 8 shortcut keys.
  • Press the Windows key to open the Start screen or switch to the Desktop (if open).
  • Press the Windows key + D will open the Windows Desktop.
  • Press the Windows key + . to pin and unpin Windows apps on the side of the screen.
  • Press the Windows key + X to open the power user menu, which gives you access to many of the features most power users would want (e.g. Device Manager and Command Prompt).
  • Press the Windows key + C to open the Charms.
  • Press the Windows key + I to open the Settings, which is the same Settings found in Charms.
  • Press and hold the Windows key + Tab to show open apps.
  • Press the Windows key + Print screen to create a screen shot, which is automatically saved into your My Pictures folder.
See our Windows shortcuts page for a full listing of all Windows shortcuts.
Know your hot corners
The corners on your screen are hot corners and give you access to different Windows features. Below, is a brief explanation of each of these corners.
Bottom Left-hand corner
The bottom left-hand hot corner of the screen will allow you to access the Start screen, if you're in the Start screen and have the Desktop open, this corner will open the Desktop from the Start screen.
Tip: Right-clicking in the left hand corner will open the power user menu.
Top-left corner of the screen
Moving the mouse to the top-left corner and then down will display all the apps running on the computer. Clicking and dragging any of these apps to the left or right-hand side of the screen will snap that app to that side of the screen. Each of these open app icons can also be right-clicked to close or snap.
Right-hand side of the screen
On the full right-hand side of the screen will be given access to the Windows Charms.
Taking advantage of search
The Search in Windows 8 has been significantly improved when compared to all previous versions of Windows. To search for a file or run a program in Windows 8 from the Start screen just start typing what you're trying to find or want to run.
As you begin typing, the results will start appearing on the left-hand side. In addition to being able to search for files and run programs, the Search also supports limiting the search to apps such as Finance, People, Maps, Photos, Mail, Music, Videos, Weather, and much more. If what you are searching for is not a file or program, click on the app you wish to use as the search. For example, if you were searching for "New York" and selected the Weather App you would be shown the weather in New York, NY.
By default, Search organizes the available Apps by how frequently they are used and then in alphabetical order. If you want to keep your favorite app at the top of the Search list, right-click the app and choose Pin. Pinning the app will lock it in place regardless of how often it is used. If there is an app you don't want (e.g. Finance) you can turn on and off any of the search apps through the PC settings, which is found under the Settings in the Charms.
Bonus tip: The Search is also found through Charms and can also be opened by pressing Windows key + F.
Running two apps side by side
Any app can be pinned to the left or right-hand side of the screen. For example, open the People app and then press the Windows Key + . (period) to move that app to the right-hand side of the screen, pressing the same keys again will move it to the left-hand side, and pressing the same keys again will make it full screen. While an app is pinned, any other app or program can be opened and loaded into the available space on the screen. For example, in the below picture, we've opened a browser window and have the People app running to monitor our social networks.
Windows 8 People
Any open app can also be pinned using your mouse by clicking at the top of the tile and dragging it to the left or right-hand side of the screen.
Bonus tip: The Desktop can also be pinned to the left or right-hand side of the screen.
Note: In order for snap to work properly your resolution must be at least 1,366 x 768.
Windows 8 Task Manager
The Windows 8 Task Manager has been significantly improved over previous versions of Windows. Some of the new changes include showing a total percent usage at the top of your Processes, which makes it easier to determine total memory and CPU usage, improved Performance graphs, a Startup tab to see startup processes and their impact to system performance, and the App history tab (as shown below) that gives you the total resources an app has used over a period of time. Press Ctrl + Shift + Esc to start exploring the new Task Manager.
Windows 8 Task Manager
Use a picture password to log into your computer
Windows 8 includes a new feature called Picture password, which allows you to authenticate with the computer using a series of gestures that include circles, straight lines, and taps. Enable this feature if you want a new way to access your computer or have a hard time with passwords.
  1. Open the Windows Charms.
  2. Click Settings and then More PC settings
  3. In the PC settings window click Users and then select Create a picture password
Bonus tip: A four digit pin password can also be created and used to access your computer.
Take advantage of Windows 8 apps
Windows 8 comes included with several apps to help you get the most from your computer. Below are just a few of the included apps.
People
Microsoft touts the People feature in Windows 8 because they understand how many people are using social networks today. In the People feature you'll be able to connect your Windows computer to all the major social networks including FacebookLinkedIn, and Twitter. Once connected, you can pin the people app and monitor your social network (as shown below), use People in Search to find people, and get an overview of what is happening in all your social networks.
Windows 8 People
Reader
The Reader app will give you PDF support right out of the box.
SkyDrive
The SkyDrive app will give you access to the Microsoft cloud service SkyDrive, which allows you to store your photos, documents, and other files in the cloud and access or share those files with any computer with Internet access.
Store
Take advantage of the Windows Store and install one or more of the thousands of available apps designed for Windows 8. The Store is found in the Start screen, or use Search to search the Store app for any apps that you are trying to find.
Know the answers to common questions
Windows 8 is the biggest change to Microsoft Windows since the introduction of Windows 95, which was released all the way back in 1995. Since so many people have grown up with Windows, it can be difficult to transition to a new way of doing things. Below, is a short list of the most common questions previous Windows users will have.
Know the Jargon
Knowing all the new jargon introduced with Windows 8 will help improve your familiarity with Windows 8 and make it a more enjoyable experience. Below, are just a few links to the most commonly used Windows 8 terms.

Sunday, 19 May 2013

KU ASSIGNMENT 4TH SEM: TB - 42 - JAVA PROGRAMMING

KU ASSIGNMENT 4TH SEM: TB - 42 - JAVA PROGRAMMING
PART-A
1. How platform independence is achieved in JAVA ?
Ans.:- Java is known as platform-neutral language because Java's byte codes are designed to be read, interpreted, and executed in exactly the same manner on any computer hardware or operating system that supports a Java run-time.
2. List any three features of JAVA.
Ans.:- The Features of JAVA
1) Simple
2) Object-Oriented
3) Distributed
3. What is Java C, Javadoc and Jdbc?
Ans. :- Java C – JavaC is a compiler translates java source code to byte code.
Javadoc – Javadoc is used for creates html format documentation from java source file.
Jdbc - A programming interface that lets Java applications access a database via the SQL language. Since Java interpreters (Java Virtual Machines) are available for all major client platforms, this allows a platform-independent database application to be
written.
4. List different features of OOP.
Ans :- The features of OOP.
1) Objects and classes
2) Abstraction
3) Encapsulation
4) Information hiding
5) Inheritance
6) Polymorphism
5. Name different types of Java tokens.
Ans. :- The different types of Java tokens are :-
1) Reserved Keywords
2) Identifiers
3) Literals
4) Operators

6. What is the task of the main method in Java program ?
Ans.:- After we specify the keywords for declaring the main() method, you specify a String array as parameter of the main() method. The String array represents command line arguments. It is compulsory for a user to specify the parameter to the main() method in all Java programs unlike in C and C++.
For example,
Class class1
{
public static void main (String args[])
{
System.out.println ("Hello")
}
}
7. Why can‟t we use a keyword as a variable name ?
Ans.:- Keywords are an essential part of a language definition. They implement specific features of the language. Java language has reserved 60 words as keywords. These keywords have specific meaning in Java, so you cannot use them as names for variables.
8. Why main method in Java is declared as static ?
Ans.:- The keyword static helps to specify that the main() method can be called without instantiating an object of a class. This is necessary because the main() method is called by the Java interpreter before any objects are created.
public static void main (String args[])
{//code}
After specifying the keyword static, you specify the void keyword. This keyword indicates to the compiler that, the main() method does not return a value.
9. Write an equivalence of switch statement and if statement.
Ans.:-equivalence of switch statement is if and the equivalence of if statement is if else.
10. Constructor is_____________.
Ans.:- used to initialize the objects of the class and has the same name as that of its class.
PART - B
1. a) What is inheritance and how one can achieve code reusability? Explain
with an example.
Ans.:-Inheritance in object oriented programming means that a class of objects can inherit properties from another class of objects. When Inheritance occurs, one class is then referred to as the „parent class‟ or super class‟ or „base class‟.
Inheritance is an important concept since it allows reuse of class definition without requiring major code changes, inheritance can mean just reusing code , or can mean that you have used a whole class of object with all its variables and functions
For ex, the bike is a part of the class two wheelers, which is again a part of the vehicle as:
Vehicle
Attributes:
Model:
Make
Two Wheeler
Attributes:
No. of wheels
Four Wheeler
Attributes:
No. of wheels
Bike
Attributes:
Scooter
Attributes:
Car
Attributes
Van
Attributes
b) What is a class? How does it accomplish data hiding? Explain with example.
Ans.:- Class is a template that defines a particular type of object. Classes contain all the features of a particular set of objects. We can use the class definition to create objects of that of class type, that is, to create objects that incorporate all the features belonging to that class.
Each object of the class will have its own copy of each of the instance variables that appear in the class definition. Each object will have its own values for each instance variable. The name 'instance variable' originates from the fact that an object is an 'instance' or an occurrence of a class and the values stored in the instance variables for the object differentiate the object from others of the same class type. An instance variable is declared within the class definition in the usual way, with a type name and a variable name, and can have an initial value specified.
A given class will only have one copy of each of its class variables, and these will be shared between all the objects of the class. The class variables exist even if no objects of the class have been created. They belong to the class, and they can be referenced by any object or class, and not just instances of that class.
Ex:- we might define a motorcycle class that describes the features of all motorcycles . the motorcycle class serves as an abstract model for the concept of a motorcycle-to interact with each type of motorcycle,we should have a concrete instance of that motorcycle.
2. a) Compare in terms of their functions and semantics the following pairs of
statements:
i) do while and while
Ans.:- The difference between the do-while statement and the while statement is that in the while statement, the loop body is executed only when the condition stated in the statement is true. In the do-while loop, the loop body is executed at least once, regardless of the condition evaluating to true or false. The while loop is also called the top tested loop whereas the do-while loop is also called the bottom tested loop.
ii) while and for
Ans.:- In the for loop, three sections, initialization, test condition and increment/decrement are placed in the same line whereas in the while loop, all three sections are placed in three different places in a program. In the for loop, more than one variable can be initialized, tested and incremented at a time.
iii) nested if and switch
Ans.:-The difference between nested if and switch statement is if allows complex expressions in the condition while switch wants a constant we can't accidentally forget the break between ifs but you can forget the else (especially during cut'n'paste) switch is usually more compact than lots of nested if else and therefore, more readable If you omit the break between two switch cases, you can fall through to the next case in many C-like languages. With if else you'd need a go to (which is not very nice to your readers ... if the language supports go to at all.
iv) break and continue.
Ans.:- The continue statement stops the current iteration of a loop and immediately starts the next iteration of the same loop. When the current iteration of a loop stops, the statements after the continue statement in the loop are not executed. The break statement immediately terminates the loop, bypassing the conditional expression and any remaining code in the body of the loop. When a break statement is encountered inside the loop, the loop is terminated and program control resumes the next statement following the loop.
b) Write a program to find sum of the following harmonic series for a given value
of n 1+ 1/2 + 1/3 + . . . .+ 1/n.
Ans.:- public class Series
{
double total;
public void calculate(int n)
{
for(double ctr=1;ctr<=n;ctr++)
{
total=total+1/ctr;
}
System.out.println("Sum of harmonic series: "+total);
}
public static void main(String a[])
{
Series object=new Series();
int num=Integer.parseInt(a[0]);
object.calculate(num);
}
}
3. a) Explain different data types in Java with example.
Ans.:- DATA TYPES IN JAVA
byte: It is the smallest integer type. This is a signed 8-bit type and has a range from -128 to 127. For example, the following declaration declares two variables B and C of type byte.
byte b,c;
b =2;
c = -114;
short: It is a signed 16-bit type and has a range from -32,768 to 32,767. For example, the following declaration declares variable K of type short.
short k;
k = 2;
int: It is a signed 32-bit type and has a range from -2,147,483,648 to 2,147,483,647.
For example,
int x = 10;
int j = 98;
long: This is signed 64-bit type and has a range from -263 to 263 -1.
For example,
long ds = 1000;
long se;
se =ds * 24 * 60 * 60;
double: It uses 64 bits to store a value.
For example,
double P, R;
P = 10.8;
R =3.14215;
float: It uses 32 bits to store a value.
For example,
float x;
x = -1111;
int : It uses 32 bits to store a value.
For example,
Int score;
Score=90;
char: this data type is used to store characters. It is 16-bit type and has a range from 0 to 65,536.
For example,
char c1,c2;
c1 =84;
c2 ='g';
boolean: it can have only one of two possible values, true or false.
For example,
boolean flag;
flag= false;
b) Describe the structure of a typical Java program.
Ans. :- :- A Java program may contain many classes of which only one class defines a main method. Classes contain data members and methods. Methods of a class operate on the data members of the class. Methods may contain data type declarations and executable statements. To write a Java program, we first define classes and then put them together.
A Java program may contain one or more sections as shown in the following figure:
Documentation Section
Suggested
Package Statement
Optional
Import Statements
Optional
Interface Statements
Optional
Class Definitions
Essential
Main Method class
{
Main Method Definition
}
Essential
General Structure Of a Java program
Documentation Section
The documentation section comprises a set of comment lines giving the name of the program, the author and other details. Java also uses the comment /**...*/ known as documentation comment.
Package Statement
The first statement allowed in a Java file is a package statement. This statement declares a package name and informs the compiler that the classes defined here belong to this package.
Example: package student;
Import Statement
The next thing after a package statement (but before any class definitions) may be a number of import statements. This is similar to the #include statement in C++. Example:
import student.test;
This statement instructs the interpreter to load the test class contained in the package student.
Interface Statements
An interface is like a class but includes a group of method declarations. This is also an optional section and is used only when we wish to implement the multiple inheritance feature in the program.
Class Definitions
A Java program may contain multiple class definitions. Classes are the primary and essential elements of a Java program.
4. a) What is JVM ? How does it help to achieve platform independence? If JVM is
available for windows then can we run program written on Unix platform ?
Comment.
Ans.:-Java compiler produces an intermediate code known as byte code for a machine that does not exist . this machine is called JAVA VIRTUAL MACHINE (JVM). . Java is known as platform-neutral language because Java's byte codes are designed to be read, interpreted, and executed in exactly the same manner on any computer hardware or operating system that supports a Java run-time.
Yes. One of the fundamental principles of Java is "write once, run anywhere." This means that Java source code can run on any platform for which a JVM exists, regardless of where the original code was developed
b) How are data and method organized in an object oriented program ? Illustrate
the same for car object.
Ans.:- In an object-oriented program, a set of variables and functions used to describe an object constitutes a "class".
A class defines the structure and behavior (data and method) that will be shared by a set of objects. Each object of a given class contains the structure and behavior defined by the class, as if it were stamped out of a mould in the shape of a class. A class is a logical construct. An object has physical reality. When we create a class, you will specify the code and data that will constitute that class. Collectively, these elements are called the members of the class. Specifically, the data defined by the class are referred to as member variables or instance variables. The code that operates on that data is referred to as member methods or just methods, which define the use of the member variables.
5. a) Distinguish between the following terms:
i) Dynamic binding and message passing.
Ans.:- Dynamic binding in java is the mechanism by which compiler cannot determine which method implementation to use in advance. Based on the class of the object, the runtime system selects the appropriate method at runtime. Dynamic binding is also needed when the compiler determines that there is more than one possible method that can be executed by a particular call.
Java's program units, classes, are loaded dynamically (when needed) by the Java run-time system. Loaded classes are then dynamically linked with existing classes to form an integrated unit. The lengthy link-and-load step required by third-generation programming languages is eliminated.
Message Passing: In an object based world the only way for anything to happen is by objects communicating with each other and acting on the results. This communication is called message passing and involves one object sending a message to another and (possibly) receiving a result.
ii) Inheritance and polymorphism.
Ans.:- Inheritance in object-oriented programming means that a class of objects can inherit properties from another class of objects. When inheritance occurs, one class is then referred as the 'parent class' or 'super class' or 'base class'. In turn, these serve as a pattern for a 'derived class' or 'subclass'.
Inheritance is an important concept since it allows reuse of class definition without requiring major code changes. Inheritance can mean just reusing code, or can mean that you have used a whole class of object with all its variables and functions.
Polymorphism: It is a key concept in object-oriented programming. Poly means many, morph means change (or 'form').
Polymorphism is simply a name given to an action that is performed by similar objects. Polymorphism allows a common data-gathering message to be sent to each class and allows each subclass object to respond to a message format in an appropriate manner to its own properties. Polymorphism encourages something we call 'extendibility'. In other words, an object or a class can have its uses extended.
b) What are the difference between C and Java ?How Java and C++ are similar?
Ans.:-
6. a) Define programming. What are the types of programming? Explain.
Ans.:- Programming:- a programming is a specific set of ordered operations for a computer to perform .
UNSTRUCTURED PROGRAMMING
In an unstructured programming the main program directly operates on global data.
PROCEDURAL PROGRAMMING
With procedural programming we are able to combine returning sequence of statements into one single place . a procedure call is used to invoke the procedure.
MODULAR PROGRAMMING
With modular programming procedures of a common functionality are grouped together into separate modules. A program therefore no longer consists of only one single part.
OBJECT-ORIENTED PROGRAMMING
In object oriented programming, a complex system is decomposed in accordance to the key abstractions of the problem.
It is a method of implementation in which programs are organized as co-operative collection of objects, each of which representation an instance of some class and whose classes all members of a hierarchy of classes united in inheritance relationships.
b) Explain bitwise operators in Java with example.
Ans.:- BITWISE OPERATORS
SHIFT AND LOGICAL OPERATORS
A shift operator allows you to perform bit manipulation on data.
OPERATOR
USE
OPERATION
>>
Op1 >> op2
Shift bits of op1 right by distance op2
<<
Op1 << op2
Shift bits of op1 left by distance op2
>>>
Op1>>> op2
Shift bits of op1 right by distance op2
Each shift operator shifts the bits of the left-hand operand over by the number of positions indicated by the right- hand operand.
Ex. – 13 >> 1
The binary representation of the number 13 is 1101. The result of the shift operations is 1101 shifted to the right by one position -1106 or 6 in decimal.
The java programming language also provides these four operators that perform logical functions on their operands :-
OPERATOR
USE
OPERATION
&
Op1 & op2
Bitwise and
|
Op1 | op2
Bitwise or
^
Op1 ^ op2
Bitwise x or
~
Op1 ~ op2
Bitwise complement
The & operation performs the logical “and” function on each parallel pair of bits in each operand . the “and” function sets the resulting bit of 1 if both operands are 1 .
Op1
Op2
RESULT
0
0
0
0
0
0
1
0
0
1
1
1
Suppose we were to “and” the values 12 and 13
12 & 13
The result of this operation is 12. Because the binary representation of 13 is 1101. The “and” function sets the resulting bit to 1 if both to 1 if both operand bits are 1, otherwise, the resulting bit is 0.
7. a) List and explain different types of loops in Java.
Ans. :- Loops in java
 While loop
·
 Do loop
·
 For loop , continue and break statement
·
THE WHILE LOOP
The while statement contains a condition and a loop body. the condition is enclosed within parentheses.
All the variables used in the condition of the while statement must be initialized before the while loop. The values of the variables used in the condition must be changed in the loop body. Otherwise, the condition may always remain true and the loop may never terminate.
Syntax:
While (test condition)
{
Body of the loop
True
};
Condition
Statement
Ex.-
Class numbers
{
Public state void main(String args[])
{
Int n = 0 ;
Int num = 5;
While (n <= num)
{
System.out.println(n);
N++
}
}
}
DO STATEMENT
Similar to the while statement, the do-while statement is a lopp statement provided by java. The statement helps to perform certain repetitive actions depending on a condition.
The major difference between the do-while statement and the while statement is that in the while statement, the loop body is executed only when the condition stated in the statement is true.
We can use the do-while loop in situations where an action must be performed at least once without evaluating the condition.
Program to print the numbers from 1 to 5
Class numbers
{
Public static void main (string args[])
{
Syntax:
While (test condition)
{ do
Body of the loop
};
False True
While
Condition
Statement
Int n=0;
Int num = 5;
Do
{
System.out.println(n);
N++;
}
While(n<=5);
}
}
FOR STATEMENTS
To manage iterative actions, java provides the for statement as an efficient alternative to the while statement. The statement creates to loop in which a set of statements is repeatedly executed until the specified condition becomes false.
The syntax of the for statement is
For(initialization expression; test condition; update expressions)
{
Statement1;
Statement2;
}
The for statement starts with the for keyword.
b) What is polymorphism? Explain method overriding with example and prove
that it is a polymorphism.
Ans.:- :- Polymorphism (from the Greek, meaning "many forms") is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation.
Ex.- a stack (which is a last-in, first-out list). You might have a program that requires three types of stacks. One stack is used for integer values, one for floating-point values, and one for characters.
METHOD OVERRIDING
In the class hierarchy, when a method in a subclass has the same name and type signature as method
in the superclass, then the method in the subclass is said to override the method in superclass.
class Book { //super class defined
String name = “JAVA PROGRAMMING” ;
int id = “34567”;
void show ( ) {
System.out.println( “Book name is “ +name);
System.out.println( “Book id is “ +id);
}
}
Save this file as book.java and compile. This is our Base Class
class Book1 extends Book { // This is the subclass
String author = “micheal janson”;
void show ( ) {
System.out.println( “Book name is “ +name);
System.out.println( “Book id is “ +id);
System.out.println( “The author name is “ +author);
}
public static void main(String args[ ] ) {
Book1 x = new Book1( );
x.show();
}
}
8. a) What is a parameterized constructor? Explain its usage with an example.
Ans:- A parameterized constructor in java is just a constructor which take some kind of parameter (variable) when is invoked. For example. class MyClass { //this is a normal constructor public MyClass(){ //do something } //this is a parameterized constructor public MyClass(int var){ //do something } //this is another parameterized constructor public MyClass(String var, Integer var2){ //do something } }
b) Explain the methods
(i) Trim
Ans. :- The trim method returns a copy of the invoking string from which any leading and trailing white space has been removed. It has the general form
String trim ( );
class altStr{
public static void main (String args[ ]) {
String str = "Hello";
String str2 = "Java";
str = str.toUpperCase();
str2 = str2.toLowerCase();
System.out.println (str); // HELLO
System.out.println (str2);// java
str = str.concat(str2); // str now equals "HELLO java"
System.out.println (str);
str = str.trim(); // str now equals "HELLOjava"
System.out.println (str);
str = str.substring (5,str.length()); // str = "java"
System.out.println (str);
str = str.replace ('a', 'i'); // str = "jivi"
System.out.println (str);
}
}
ii) substring
The subString method is used to create new instances of the class String from existing instances. The new string is specified by giving the required index range within the existing string.
String substring(int startIndex)
This returns the sub string that starts at startIndex and runs to the end of the invoking string.
String substring(int start Index, int endIndex)
This returns the substring that starts at startindex and runs through endIndex-1;
iii) length
The length of a string is the number of characters that it contains. To obtain this value call a length method.
int length();
class strCmp {
public static void main (String args[ ]) {
String str = "Hello";
String str2 = "Java";
System.out.println (str.equals(str2)); // false
System.out.println (str.compareTo(str2)); // a negative number,
i.e. str is less than str2
System.out.println (str.charAt(0)); // H, i.e. char is position 0
System.out.println (str.length() + str2.length()); // 5 + 4 = 9
}
}




Windows 7 & 8 Tips

Click Hear To Know About India

KU Guess 4TH SEM TB - 44 - SOFTWARE ENGINEERING

KU Guess 4TH SEM TB - 44 - SOFTWARE ENGINEERING
PART – A
I. Fill up the blanks using suitable word or phrase in the following sentences:
1) Software is a set of_____________that when executed provide desired function
and performance.
Ans. INSTRUCTIONS OR COMPUTER PROGRAMS
2) Software is a process and _____________.
Ans.:- PRODUCT
3) The_____________method is also known as the iterative enhancement model.
Ans. INCREMENTAL MODEL
4) An external entity is represented using _____________ in a DFD.
Ans. EXTERNAL DESIGN INTERFACE
5) The software requirements deal with the_____________of the proposed system.
Ans.- REQUIREMENTS
6) The weakest coupling that is most desirable is _____________.
Ans.- DATA COUPLING
7) The three important levels of abstraction are _____________,_____________,
and_____________.
Ans. PHYSICAL LEVEL, LOGICAL LEVEL ,VIEW LEVEL
8) P.D.L. stands for_____________.
Ans. PROGRAM DESIGN LANGUAGE
9) _____________helps to view the source code.
Ans. BROWSING TOOLS
10) _____________tools help in code creation, debugging and testing.
Ans.- EXECUTABLE CODE
11) The two kinds of program documentation are _____________and_____________
Ans. – INTERNAL AND EXTERNAL
12) Estimation makes use of an important approach_____________.
Ans.- DECOMPOSITION
13) PERT stands for_____________.
Ans. :- PROGRAM EVALUATION AND REVIEW TECHNIQUE

II. Write brief answers to the following questions:
1) Define the terms risk mitigation, risk monitoring.
Ans.:- Risk mitigation refers to avoiding risks by developing a strategy for reducing the turn over thereby adopting a proactive approach to risks. Risk monitoring refers to monitoring the facts that may provide an indication of whether the risk is becoming more or less likely.
2) Name the important approaches used in program debugging.
Ans.:- There are three debugging approaches commonly used
- It occurs as a consequence of successful testing.
- When a test can uncovers an error, then debugging, a process that results in the removal of errors occur.
- Debugging process begins with the execution of test cases.
3) What are specification languages? Give an example.
Ans.:- specification languages posses many desired qualities of an SRS. Unlike formal languages of SRS must be exact, without ambiguity, and precise because the design specification, statement of work, and other project documents are what drive the development of the final product. Example :-Structured English, Regular Expression.
PART - B
1. a) What is software? List out the important characteristics of software.
Ans.:- Software is a set of instructions of computer programs that when executed provide desired function and performance. It is both a process and a product. To gain an understanding of software, it is important to examine the characteristics of software, which differ considerably from those of hardware.
Software Characteristic
1). Software is developed or engineered, it is not manufactured.
Unlike hardware, software is logical rather than physical. It has to be designed well before producing it. In spite of availability of many automated software development tools, it is the skill of the individual, creativity of the developers and proper management by the project manager that counts for a good software product.
2). Software does not “wear out”.
The hardware components start deteriorating – they are subjected to environmental maladies such as dust, vibration, temperature etc. and at some point of time they tend to breakdown. The defected components can then be traced and replaced.
3) Most software is custom-built, rather than being assembled from existing components
Most of the engineered products are first designed before they are manufactured. Designing includes identifying various components for the product before they are actually assembled. Here several people can work independently on these components thus making the manufacturing system highly flexible. in software , breaking a program into modules is a difficult task, since each module is highly interlinked with other modules.
b) Explain the waterfall model of software process. What are its limitations?
Ans.:-It is the simplest and the widely used process model for software development. Here the phases involved in the software development are organized in a linear order.
In a typical waterfall model, a project begins with the feasibility analysis. on successfully demonstrating the feasibility of a project, the requirements analysis and project planning begins. The design starts after completing the requirements analysis and coding starts after completing the design phase.
The limitations of waterfall model are:
nThe model states that the entire set of requirements should be frozen before development begins. This is possible for small projects, but is difficult for large projects where the exact requirements may not be known in advance.
nThe waterfall model requires formal documents after each phase. This is not possible in GUI-based applications where the documentation will be very extensive.
nThe customer sees the software only at the end of the development phase. As a result, the customer cannot suggest any changes until the product is delivered.
2. a) Describe the three generic views of software engineering.
Ans.:- The software engineering as such can be categorized in to three generic phases, regardless of application area, project size or complexity.
The three generic phases of software engineering are :-
 The definition phase
·
 The development phase
·
Formatted: Bullets and Numbering
 The maintenance phase
·
The definition phase developer attempts to identify what information is to be processed, what function and performance are desired, what system behavior can be expected, what interfaces are to be established, what design constraints exists, and what validation criteria are required to define a successful system.
The development phase attempts to define how data are to be structured, how function is to be implemented as a software architecture, how produces are to be implemented, how design will be translated, into a programming language, how testing will be performed.
The maintenance phase focus on change that is associated with the software.
Correction:- it is likely that are customers will find errors or defects in the software in spite of quality assurance activities.
Adaptations – As time progress, it is likely that the original environment for which the software was developed is likely to change.
Enhancement – as software is used, the customer will recognize the need for additional functional requirements that will benefit him.
Prevention – computer software deteriorates due to change. so, preventive maintenance, often called software reengineering must be conducted in order to make changes to the computer software more easily.
b) List out the important characteristics of good SRS.
Ans.:- A good SRS should be:
nComplete
nConsistent
nAccurate
nModifiable
nRanked
nTestable
nTraceable
nUnambiguous
nValid
3. a) Give the outline structure of SRS.
Ans.:- The outline of SRS structure is:
Introduction
1.1 Purpose
1.2 Document conventions
1.3 Intended audience
1.4 Additional information Formatted: Bullets and Numbering
1.5 Contact information/SRS team members
1.6 References
Overall Description
2.1 Product perspective
2.2 Product functions
2.3 User classes and characteristics
2.4 Operating environment
2.5 User environment
2.6 Design/implementation constraints
2.7 Assumptions and dependencies
External Interface Requirements
3.1 User interfaces
3.2 Hardware interfaces
3.3 Software interfaces
3.4 Communication protocols and interfaces
System Features
4.1 System feature A
4.1.1 Description and priority
4.1.2 Action/result
4.1.3 Functional requirements
4.2 System feature B
Other Nonfunctional Requirements
5.1 Performance requirements
5.2 Safety requirements
5.3 Security requirements
5.4 Software quality attributes
5.5 Project documentation
5.6 User documentation
b) Why is design an important phase in software development life cycle? Describe
design process.
Ans.:- Design is an important phase in the software development life cycle because it bridges the requirements specification and the final solution for satisfying the requirements.
The software design is an activity which is after the requirements analysis activity. This phase begins when the requirements document for the system to developed is available. Design is an important phase in the software development life cycle, it bridges the requirements specification and the final solution for satisfying the requirements.
The design process for the software has two levels:-
1. System design or top-level design
2. Detailed design or logic design
System design
Using this, the modules that are needed for the system are decided, the specifications of these modules and how these modules need to be connected are also decided.
Detailed design
Using this, the internal design of the modules are decided or how the specifications of the modules can be satisfied are decided. This type of design essentially expands the system design to contain more detailed description of the processing logic and data structures so that the designs is sufficiently complete for coding.
4. Outline programming guidelines with regard to;
i) Control structures ii) Algorithms
iii) Data structures and iv) General guidelines
i) Control Structures :- Many of the control structures for a program component are given by the architecture and design of a system. And the given design is translated in to code. In case of some architecture, such as implicit invocation and object-oriented design, control is based on the system states and changes in variables.
ii) Algorithms:- The program design often specifies a class of algorithms to be used in coding. For example, the design may tell the programmer to use binary search technique. Even though, a programmer has lot of flexibility in converting the algorithm to code, it depends on the constraints of the implementation language and hardware.
iii) Data Structures :- Data structures can influence the organization and flow of a program. In some cases , it can even influence the choice of programming language. For example, LISP is a language for list processing. It is so designed that it contains structures that make it much easier for handling lists than other languages.
iv) General Guidelines :- there are several strategies that are useful in preserving the design quality of a program:-
 Localization input and output :- those parts of a program that read
· input or generate output are highly specialized and must reflect characteristics of the underlying hardware and software .
 Pseudo-code can be used for transforming the design to code through a chosen programming language.
·
 Revise the design and rewrite the code until one is completely satisfied with the result.
·
 Reuse code components if possible.
·
5. a) What is software testing ? Describe the two ways of testing any engineered
software product.
Ans.:- Software testing is the process of testing the functionality and correctness of software by running it.
The two ways of testing any engineered software product :-
1) White-Box Testing
2) Black-Box testing
Black-box testing
It is also known as functional testing. Knowing the specified function that the product has been designed to perform, tests can be conducted to demonstrate that each function is fully operational
Example :- Boundary value analysis.
White Box Testing
It is also known as structural testing. Knowing the internal working of product, test can be conducted to ensure that all internal operations perform according to specification that all internal components have been adequately.
EXAMPLE :- basic path testing.
b) What is the difference between verification and validation ?
Ans.:- Verification is a set of activities that ensures that the software correctly implements a specified function while Validation is a set of activities that ensures that the software that has been built, is traceable to the customer requirements.
6. a) Describe the different kinds of software development team structure.
Ans.:- The different kinds of software development team structure are:
nDemocratic decentralized team
nControlled centralized team
Controlled decentralized team
Democratic decentralized team
 It consists of ten or few number of programmers.
·
 The goals of the group are set by consensus
·
Formatted: Bullets and Numbering
 Every member is considered for taking major decision
·
 Group leadership rotates among group member
·
Controlled centralized team
 It consists of a chief programmer, who is responsible for all the
· major technical decisions of the project. He also does most of the design activities and allocates coding part to each and every member of the team.
 Under him, he has a backup programmer, program librarian, and programmers
·
 The backup programmer helps the chief in making decisions and takes over the role of chief in absence of the chief programmer.
·
 The program librarian is responsible for maintaining the documents and other communication related work.
·
Controlled decentralized team
 It combines the strength of the democratic and chief programmer teams
·
 It consists of a project leader who has a group of senior programmers
· under him and a group of junior programmers under a senior programmer.
 The communication between the senior and junior programmers are like ego-less team,
·
 This structure is best suited for every simple projects or research-type works.
·
b) What is COCOMO model? Explain the basic COCOMO model.
Ans.:-The COCOMO model predicts the effort and duration of a project based on inputs relating to the size of the resulting system and a number of “cost drivers” that affect productivity.
THE BASIC COCOMO MODEL
Basic COCOMO model estimates the software development effort using only a single predictor variable and three software development modes. Basic COCOMO is good for quick, early, rough, order of magnitude estimates of software costs, but its accuracy is necessarily limited because of its lack of factors which have a significant influence on software costs. The basic equation for the COCOMO model is about the effort estimate in persons –month required develop a project and the KLOC, the number of delivered lines of code for the project.
7. a) Define the terms: quality, quality assurance and quality control.
Ans.:- QUALITY:- Software quality is conformance to the explicitly stated functional and performance requirements, explicitly documented development standards, and implicit characteristics that are expected of all professionally developed software.
QUALITY ASSURANCE :- Quality assurance is an auditing and reporting function of management.
QUALITY CONTROL :- Quality control consists of a series of activities like inspections, reviews, and tests, which are carried out during the entire life cycle of software, so that each work product meets the requirements, placed upon it.
b) Mention the objectives of formal technical review.
Ans.:- This is a software quality assurance activity that is performed by software engineers.
OBJECTIVES
 To detect the errors in functions, logic or implementation found in software.
·
 To verify that the software under review meets its requirements.
·
 To ensure that the software has been represented according to predefined standards
·
 To achieve software with consistent quality and on time
·
 To make projects more manageable.
·
 It acts as a training ground for junior engineers to observe different approaches to software analysis, design, implementation
·
 FTR includes walkthroughs, inspections, round-robin reviews.
·
8. Write short notes on:
a) Software engineering
Ans.:-Software engineering is a discipline. It uses the existing tools and methods of software development and systematizes the entire process of software development. There are a number of formal definitions for software engineering, given by experts in the field. However for the purpose of understanding , we shall see some of them.
“The application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, that is , the application of engineering to software “.
b) The spiral model of software process
Ans.:-The activities in this model can be organized like a spiral, that has many cycles. Typically the inner cycles represent the early phase of requirement analysis along with the prototyping and the outer spirals represent the classic software lifecycle.
This model has been divided into four quadrants, each quadrant representing a major activity like planning, risk analysis engineering and customer evaluation. The software process cycle begins with the planning activity represented by the first quadrant
of this model. Each cycle here begins with the identification of objectives for that cycle, the alternatives and constraints associated with that objective.
c) Programming tools.
Ans.:-programming tools is used to reduce time spent on the development of programs.
The tools which used in programming tools
1) source-code tools
- editing tools, these relate to the editing of source code
- browsing tools, helps to view the source code
The source-code beautifiers and templates not only makes a program look consistent but also standardize indentation styles, align variable declarations and format comments.
2) Executable code tools
Tools that are required for working with executable codes. it helps in code creation, debugging and testing
3) code creation has four major tools which help the developer in converting the source code into executable code :
4) Debugging tools help in debugging the code.
5) testing tools help in tracing the code errors.



Click Hear For New India  Awesome India.