Friday, December 24, 2010

computer science mini project topics for you

Mini Project Ideas

1. NAT
2. honeypots
3. Creation of a DMZ
4. Creation of a sniffer and a port scanner
5. GSM
6. Library Management System
7. Hotel Management System
8. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
9. CD library management
10. Admission procedure
11. Online passport registeration
12. Examination result according to the classes
13. Ice cream parlour management system
14. Pizza hut - account management system
15. Multi player strategy game: Project ideas on Visual basic,Java,Database
16. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
17. You can develop a Microsoft Word like application in VB ( a text editor basically)
18. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
19. Voice Mail Systems
20. Computer Telephony Integration . Hotel Management System
. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
. CD library management
. Admission procedure
21. Online passport registeration
22. Examination result according to the classes
23. Ice cream parlour management system
24. Pizza hut - account management system
25. Multi player strategy game: Project ideas on Visual basic,Java,Database
26. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
27. You can develop a Microsoft Word like application in VB ( a text editor basically)
28. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
29. Voice Mail Systems
30. Computer Telephony Integration
31. Interfacing alphanumeric LCD 16x2 using VB6
32. Registry Editor

computer science mini project topics for you

Mini Project Ideas

1. NAT
2. honeypots
3. Creation of a DMZ
4. Creation of a sniffer and a port scanner
5. GSM
6. Library Management System
7. Hotel Management System
8. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
9. CD library management
10. Admission procedure
11. Online passport registeration
12. Examination result according to the classes
13. Ice cream parlour management system
14. Pizza hut - account management system
15. Multi player strategy game: Project ideas on Visual basic,Java,Database
16. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
17. You can develop a Microsoft Word like application in VB ( a text editor basically)
18. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
19. Voice Mail Systems
20. Computer Telephony Integration . Hotel Management System
. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
. CD library management
. Admission procedure
21. Online passport registeration
22. Examination result according to the classes
23. Ice cream parlour management system
24. Pizza hut - account management system
25. Multi player strategy game: Project ideas on Visual basic,Java,Database
26. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
27. You can develop a Microsoft Word like application in VB ( a text editor basically)
28. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
29. Voice Mail Systems
30. Computer Telephony Integration
31. Interfacing alphanumeric LCD 16x2 using VB6
32. Registry Editor

Sunday, December 19, 2010

How to Select and Plan Mini Projects and Paper Presentation Topics in Colleges and Universities

How to Select and Plan Mini Projects and Paper Presentation Topics in Colleges and Universities


There would be a definite craze in you to endeavor mini projects in your college life. Influence yourself in doing a constructive work like this which can bring a big difference to your knowledge. Develop the passion for few subjects and master those subjects by dedicating more time towards it. Attempting a mini project and coming up with success can be a cake walk if you have the fervor to learn the subject practically. You can really be outstanding once you start acquiring practical knowledge by doing mini projects. Do not wait for time, place and instructions. Search for the options available and explore.
Choosing Topic
From the subjects that you are studying in your semesters, you can take up one which you like the most. Say for example, you are having flair towards Digital Electronics; learn all the basic gates, their logic and circuits associated with it. Find books, get assistance from your staff and use the internet to see the application of digital Electronics. As a first step, look for a mini project that has already been done. Take it up and try doing it on your own. You will have difficulties when you start which will turn as a stepping stone for your success. With the amount of experience you are gaining in doing a project that has been well prescribed, you can really move on questing more into this area.
Finding Time
The beginning of the semester is the best time where you can start thinking about the project. In fact, for a learning process like this, there need not be any specific time. Never get bogged down with the internal exams, tests and other routine stuff in college as they are going to keep coming at you. Spare just an hour in a day over a period of two to three weeks and this will be exceedingly enough to complete the project.
Resources
Plan your project and look for the resources that you can avail. When it is a software based project, there is nothing you will have to possess other than a computer. Look where you can spend time in doing the project whether in home or in laboratories in your college. You can fetch books from established libraries at very low cost and you can have the eternal internet reference by your side. Speak about your initiative to your staff and learn things from them. Every person will not be strong in all the subjects but will have strengths in one or other areas. Counsel with the staff whom you feel is good in that area and get ideas to proceed.
Forming Team
It is much better to do a mini project with couple of class mates by your side than doing it individually. Team effort saves time and cost for you and the knowledge that you can share and develop amongst yourselves will also be high. Motivate yourself and your team members in venturing mini projects.

Information Technology ( IT ) Mini Projects - Tips and Latest Trends

Information Technology ( IT ) Mini Projects - Tips and Latest Trends

The wide range of information, data, and knowledge for problem solving and decision making are dealt with Information Technology. Demanding needs of users has always been fulfilled by Information Technology with establishing trends. Before starting with the projects, students should be aware of authentication, and integrity features in their projects. Breaking of passwords and hacking can be avoided using these techniques. Anyhow, the various trends for projects are based on the emerging software technology.
Flash Technology
To add multiple types of external data to the given text, images, video, XML and to interact with web pages, Adobe Flash is used. It provides multimedia platform. The main purpose of this technology is to be used in advertisements and games. Both audio and video streams are supported by flash. One of the Object-oriented languages called ActionScript is the language used here by the developers. Flash player includes ActionScript Virtual Machine (AVM). The compiler, Just-In-Time (JIT), is used for MP3-based audio and bitmap graphics. Flash CS5 is the latest version of Adobe flash which was released on April 12, 2010.
Microsoft Silverlight
Microsoft Silverlight is developed on web framework and is similar to the functions of those in Adobe Flash. In addition, it also integrates multimedia graphics and interaction with a single runtime environment. Common Language Infrastructure (CLI) and its development tools are supported by Silverlight. The processor x86 with streaming SIMD Extensions (SSE) is used by Silverlight. Also the other processors which support Silverlight include the Intel Pentium III and AMD Athlon XP. Any of the .Net Programming language is supported for Silverlight applications. The developing tools for the application can be used along with the .Net language but should be aware that they can target only the Silverlight core CLR for hosting the applications and not that of the .Net Framework CLR since both differs in their own functionalities. 4GDR1 (4.0.50524.0) is the latest version of Silverlight and was released on 03 June 2010
Open Source Software
Open source software is newly emerging trend which is one of the best options for the students. The source code can be modified by the students as per the objective of project. Hence Open source is much flexible than closed version software. Open source software is mainly developed on peer to peer production by collaboration of end product, source material. Open source software can be enhanced by anyone and if you join some open source developers community, you can learn a lot of things directly from the most knowledged persons in the developers community. Even the top companies like Google who are paymasters gives lots of importance to candidates who have worked in open source projects during the interviews.
http://sourceforge.net is one of the biggest open source community and you can engage in one of the groups or even start a new project.
Cryptography
Cryptography is the practice and study of hiding information. It also refers to confidentiality. It is often seen as a “black art”, which means something others don’t understand but you need to understand. Cryptography is one of the essential aspects for secure communication. There are many aspects of security and applications ranging from secure commerce to private communication and to protect passwords. Cryptography is necessary for secure communication but it is not sufficient by itself. Here, the text is encrypted first; i.e the plain text is changed to inarticulate garbage. The end user does the reverse process i.e decryption, where the original text is retrieved. There are a lot of algorithms in this area which is used in real time for data protection in sectors like banks, Research, Password Protection and so on.
Nanotechnology
Nanotechnology is the study of controlling properties of an atom and molecules. As the name indicates, it deals with the study of structures sized between 1 and 100 nanometer. It is said that, nanotechnology has a tendency to create new materials and devices which can be used in future in a wide range of fields such as medicine, energy production, electronics and bio materials. As they are very small in size, nano structures have a tendency to change its state for transformation of energy. The two main approaches used in nanotechnology are Bottom-up and Top-down. In bottom-up approach, materials and devices are built from molecular, a component which later assemble themselves chemically and follows the principles of molecular recognition. In top-down approach, nano-objects are constructed from larger entities without any atomic level control. Biotechnology is the best example to show the use of nanotechnology in various fields.
Conclusion
The upcoming trends mainly focus on security and hacking. Mobile application for iPhone and Android are great areas to explore with good revenue opportunities as well. If you want to stand out from others, instead of going for some courses, try to contribute for an open source project.

How To Prepare a Project Report

How To Prepare a Project Report

Report writing is one of the primary objects of any student who are in the threshold of completing their graduation. It is to be noted that the final report is not to be done for sheer formality. This report acts as a tool for judging the professional skill of the new engineer. It is also considered to be an extended service for the engineering students who might require information. Remember this report will be subjected to critical analysis by many readers.
Hence to prepare the final report, an engineering graduate must have good knowledge about the practical skills that will be required to solve an engineering problem. All sorts of resources must be compiled to create a report. Experimenting by using the lab, analyzing the theories, observation, details with regard to how to use the equipments, and work experience with others. The most important aspect is one must have a good flair for writing and ideas must be well communicated and the information should be authentic.
There are structural guidelines that one needs to follow while preparing a project report for final year engineering. This format is applicable to all types of students.
Title Page
The following details must be given
· Title
· Authors full name
· Discipline and degree
· Appropriate industrial and other collaboration
· Month and year of submission
It is important that this page will not show any page number
Abstract
Here one has to pint out the main ideas of what the project is about, how it was visualized, and what has been achieved. All this must fit into one page.
Content List
Here one must give a complete list of what the report will contain including the abstract. Make sure that the title page is not included in this list. Here you will be providing chapter wise list.
List of Tables/Figures
A list of tables and figures must be provided if the report contains tables/figures. The list must include table/figure number, title of the table/figure and also page number. These must be numbered sequential throughout the document. The table/figure must highlight clearly the points you are making. Fit the contents of the table within a page. Use a smaller font if necessary or place it in a landscape mode.

Acknowledgements
It is normal to thank all the people who have helped you and provided support. It could be your guide/supervisor. Acknowledgements should be short and business like.
Background.
This area deals with the subject area of the project.
· Chapter 1 : Background
- Motivation
- Problems description
- Objectives of the work
- Organization of the report
Introduction
Here you must include specific topic related problems that you would be researching. Include your research design, hypothesis etc.
· Chapter 2: Introduction
- Details of relevant theory
- Review of past/reported work
- Brief introduction of the proposed work/solution
Methodology
This is the main body of the report. This will include the following:
· Chapter 3: Deals in accordance with the title that is to be researched.
- Main work
- Theory
- Simulation software
- Solution approach
- Design or circuit
· Chapter 4:
- Method to be described
- Presentation of Data
- Results
- Findings
· Chapter 5: Evaluation [ this could be an optional]
- Provide objectives of evaluation
- Compare with other works
Conclusion
· Chapter 6: Conclusion
- Review of the project in brief
- Reiteration of important findings
- Suggestion of future work

Appendices
This has to be numbered sequentially with Appendix 1. Numbering of pages will include appendices.
References and Bibliography
Usually a number of reference materials will be used in a report. The use of source material should be explicit in the report. Every item mentioned in the report must have an entry in the reference list. There are many styles that are followed like APA etc. It follows a sequential order
Books
Title of the book, name of the author, year of publication, and name of the publishers can be included.
Journal
Author(s) name, year of publication, title of the article, name of the journal, volume, year of publication and page numbers can be included.
Website
Do not specify as Google/Yahoo. Specify the exact url of the website rather than specifying the top level domain like www.xyz.com
Instead specify as www.xyz.com/abc.html
The above is the basic structure of a report. There are hard fast rules one must apply when writing the report. Some are discussed below:
Formatting of the report
Please use Microsoft Word so that all information that is explained will have good looks as these help you to avoid rearrangements. Also make sure that the document is Word 2003 compatible.
Length
Basically there are no hard fast rules and the length can vary from person to person depending on the project. It is advisable for an engineering report to have around 100 pages. These will include tables and appendices.
Language of Report
Report must be written in English as this is considered to be consistent form. Certain grammar rules needs to be followed
Apostrophes: This is the most common mistakes all students make. In English language the apostrophes is used as a contraction. In an academic writing the words must be written in its full form and words should not be shortened.
Acronyms:
Science and engineering fields use lot of acronyms and will be familiar only to specialists who are familiar with the subjects. When using it for first time always give it the expanded version.
Colloquialisms:
Avoid usage of slang, phrases, idiomatic and chatty expressions while writing a report. In an academic or technical writing avoid using the first person ‘I’ as much as possible and also do not refer to the reader as ‘you’
Grammar:
Make your sentences small and write it as whole sentences. Proofread your writing every 3-4 hours so that you will be able understand the text as it was to be meant. Ensure that the writing is clear and it follows the basic grammar rules.
Jargon:
Be consistent while using technical terms. Please define and use the same words when you are writing about the same concept.
Spelling:
There are no excuses for spelling mistakes. It creates a bad impression. Take the help of spell checker or dictionary. Spell checker will not be useful if the words spelt are correct ex. ‘from’ or ‘form’ Hence a manual spell check is advisable to ensure the correct word fits into the sentences. Hence proof reading is always suggested.
Typeface and Font Size
Times New Roman typeface and font size of 12-point should be used throughout the report except for Appendices. Italics should only be used sparingly for emphasis.
Paper
High quality 80gm A4 size paper shall be used. The paper should be white in colour, acid free and non-erasable kind.
Printing
Printing has to be done on one side only. It is recommended to use a laser or ink jet printer. Avoid dot matrix printers.
Corrections
Corrections of typographical errors, or changes in the text, figures, or tables, must be made as cleanly and invisibly as possible. Do not use Correction fluid. Corrections should be made on the original word document before printing the problem page.
Margins
The margin on the document must measure according to the following specifications:
Top : 25mm
Bottom : 20mm
Left : 20mm
Right : 20mm

Spacing/Justification
Text should be typed, one and a half-spaced, left-right justified on one side of the paper only. For captions of figures and tables, single spacing can be used.
Pagination
Page numbers are to be placed at least 15 mm from the edge of the page at the bottom centre of the page. Every page except the title page must be numbered.
Title page is 'i' but is not numbered. Preliminary pages are to be numbered in lower case Roman numerals (ii, iii, iv etc).
The main text pages are to be numbered in numerals and all pages must be numbered consecutively and continuously.
Header
A header should be included at the top of each page from the title page. It will include candidate’s name, qualification sought and calendar year.
Paragraph
This should be separated by a single blank line.
Citations
Whenever more than 30 words are quoted from other person’s work the authors name should appear in the references. When small words are quoted, these can be written within quotation marks.
Plagiarism
This should be avoided at any cost. Try to use the content of the subject matter but do not copy word to word. Words and sentences can be rephrased and written. This can lead to serious trouble and it will be treated as an offence as many come under the copyright category.
Hence it is to be noted that report writing is an art by itself and one has to follow the normal procedures.

Difference between CV, Resume and Cover Letter

Difference between CV, Resume and Cover Letter

For most of you, a CV and a Resume typically mean different names of the same version but sent to people or companies belonging to different countries namely US and Britain.
Trying to find the relationship between a Resume and CV is one thing, but relating these two to Cover Letter is a completely diversified subject.
Both Resume and CV give an account of a person’s qualifications and his achievements, but the cover letter is a short description of what to expect in the resume or CV and perfect reasons as to why you are applying to the job.
Hence, understanding how Resume, CV and Cover letter are different from another and also how to effectively write them so that your prospective employer would want to read ahead, is very important.
Some critical differences
Length
A CV or the curriculum vitae basically means “course of life”. As the meaning, it is a detailed description of your history of educational and employment that is completely updated. It is a long document having at least two pages.
On the other hand, the Resume is shorter and consists of a single page. Here you are required to give a focused account of your skill and talent that are required for that particular job. You can mention your experience in the relevant field.
Purpose
The purpose of CV is to give a detailed account of your educational achievements, qualifications, awards received, scholarships and experience in the required field. A CV is particularly used when a post doctoral position or teaching position is sought.
A Resume is used to highlight briefly on your talents that are transferable to the intended company and show how useful you would be to the future growth of the company. Thus no details are expected here.
Though CVs are common form of job application, people in US always prefer a Resume.
CVs are more descriptive whereas Resumes are self promoting in nature.
CV sections
A CV usually is sectioned under separate subheadings such as objective, educational qualifications, skills, awards/ medals won and career summary etc.
You can present the information in bullet points or tables, so that your prospective employer may get an idea of what you want to highlight.
Resume sections
A Resume can also be sectioned just as in CVs, however all the information is not required. Depending on the type of Resume you may change the information provided.
A Functional Resume should highlight your skills and qualifications. A Chronological Resume is concise form of CV and a Targeted Resume gives specific information that is required for the job you are applying.
Cover Letter
Cover Letter basically is a formal letter that is presented as a prelude to CV or Resume which briefly but effectively gives an insight of what can be expected inside.
Writing an efficient and catchy Cover Letter is very crucial because it has the capacity to decide the fate of your application and thereby your fate.
Some important points that you have to keep in mind while writing a cover letter are
· Keep your Cover Letter Linked to your CV. This provokes enough interest in your prospective employer to read the CV thoroughly.
· Make the letter sound as if you are personally speaking. Address the person to whom you intend to send the CV, giving a personal and emotional touch.
· The letter should be brief giving a crisp description.
· The person reading the letter does not expect any excess pompous information about you. Too much “I: factor could turn them down.
· Most Important –DO NOT MAKE TYPO AND GRAMMATICAL ERRORS. This would surely spoil your image.
Though basically CVs and Resumes mean and give the same information, they are quite different from one another. Choosing the right form of your personal information you have to present on specific occasion gives you better chance of getting the intended job.
A well crafted cover letter along with a neatly thought out and written CV or Resume gives better chances of success to you.

mini projects for b=tech computer science branch

Mini Projects in Java: 1)Network Security in Ecommerse 2)Media Player 3)Web Browser 4)Jukebox 5)SMS query system a lots of Regards Sajith

Mini Project Ideas

1. NAT
2. honeypots
3. Creation of a DMZ
4. Creation of a sniffer and a port scanner
5. GSM
6. Library Management System
7. Hotel Management System
8. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
9. CD library management
10. Admission procedure
11. Online passport registeration
12. Examination result according to the classes
13. Ice cream parlour management system
14. Pizza hut - account management system
15. Multi player strategy game: Project ideas on Visual basic,Java,Database
16. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
17. You can develop a Microsoft Word like application in VB ( a text editor basically)
18. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
19. Voice Mail Systems
20. Computer Telephony Integration

We get a huge number of engineering students looking for seminar topics and mini project ideas. So, let's compile all the project ideas / seminar topics we've discussed so far on CE 

So, please add your ideas to the list :-

Mini Project Ideas

1. NAT
2. honeypots
3. Creation of a DMZ
4. Creation of a sniffer and a port scanner
5. GSM
6. Library Management System
7. Hotel Management System
8. Timetable generation (user will input subjects, faculty times, class room times) : User will also input subject seriality and topics to be taken for the week.
9. CD library management
10. Admission procedure
11. Online passport registeration
12. Examination result according to the classes
13. Ice cream parlour management system
14. Pizza hut - account management system
15. Multi player strategy game: Project ideas on Visual basic,Java,Database
16. You can develop a speech reponse application using some hardware interface using the Microsoft SAPI SDK
17. You can develop a Microsoft Word like application in VB ( a text editor basically)
18. You can develop a LAN administrator tool (socket programming comes easy in VB) which will monitor application on a LAN and provide functions
19. Voice Mail Systems
20. Computer Telephony Integration


Seminar Topics:

1. GSM
2. Viruses
3. Bluetooth Technology
4. CDMA
5. Artificial Intelligence
6. Spyware
7. Quantum Computing
8. Blue - Ray Disc
9. Robotics
10. RFID
11. MANET
12. WAP
13. DNA Computing in security
14. 4g Wireless Systems
15. HomeRF- localized wireless technology optimized for the home environment
16. Internet Searching
17. Zigbee
18. Java Management Extensions (JMX) - component framework for building intelligent network
19. Earth Simulator
- Fastest Supercomputer
20. Home Networking
21. TouchFLO Technology <
22. Tracking and Positioning of Mobiles in Telecommunication
23. 3D Volume Storage
24. Optical Networking and Dense Wavelength Division Multiplexing
25. Software-Defined Radio <
26. Space-time adaptive processing
27. Secure File Transfer (use PGP, deflate or nay encryption method)
28. A Secure GateWay

Friday, December 10, 2010

Learn c# easily lesson 6

<------previous lesson 

The string Type

A string is a sequence of text characters. You typically create a string with a string literal, enclosed in quotes: "This is an example of a string." You've seen strings being used in Lesson 1, where we used theConsole.WriteLine method to send output to the console.
Some characters aren't printable, but you still need to use them in strings. Therefore, C# has a special syntax where characters can be escaped to represent non-printable characters. For example, it is common to use newlines in text, which is represented by the '\n' char. The backslash, '\', represents the escape. When preceded by the escape character, the 'n' is no longer interpreted as an alphabetical character, but now represents a newline.
You may be now wondering how you could represent a backslash character in your code. We have to escape that too by typing two backslashes, as in '\\'. table 2-3 shows a list of common escape sequences.
Table 2-3. C# Character Escape Sequences
Escape SequenceMeaning
\'Single Quote
\"Double Quote
\\Backslash
\0Null, not the same as the C# null value
\aBell
\bBackspace
\fform Feed
\nNewline
\rCarriage Return
\tHorizontal Tab
\vVertical Tab
Another useful feature of C# strings is the verbatim literal, which is a string with a @ symbol prefix, as in @"Some string". Verbatim literals make escape sequences translate as normal characters to enhance readability. To appreciate the value of verbatim literals, consider a path statement such as "c:\\topdir\\subdir\\subdir\\myapp.exe". As you can see, the backslashes are escaped, causing the string to be less readable. You can improve the string with a verbatim literal, like this: @"c:\topdir\subdir\subdir\myapp.exe".
That is fine, but now you have the problem where quoting text is not as easy. In that case, you would specify double double quotes. For example, the string "copy \"c:\\source file name with spaces.txt\" c:\\newfilename.txt" would be written as the verbatim literal @"copy ""c:\source file name with spaces.txt"" c:\newfilename.txt".

C# Operators

Results are computed by building expressions.  These expressions are built by combining variables and operators together into statements.  The following table describes the allowable operators, their precedence, and associativity.
Table 2-4. Operators with their precedence and Associativity
Category (by precedence)Operator(s)Associativity
Primaryx.y  f(x)  a[x]  x++  x--  new  typeof  default  checked  unchecked delegateleft
Unary+  -  !  ~  ++x  --x  (T)xleft
Multiplicative*  /  %left
Additive+  -left
Shift<<  >>left
Relational<  >  <=  >=  is asleft
Equality==  !=right
Logical AND&left
Logical XOR^left
Logical OR|left
Conditional AND&&left
Conditional OR||left
Null Coalescing??left
Ternary?:right
Assignment=  *=  /=  %=  +=  -=  <<=  >>=  &=  ^=  |=  =>right
Left associativity means that operations are evaluated from left to right. Right associativity mean all operations occur from right to left, such as assignment operators where everything to the right is evaluated before the result is placed into the variable on the left.
Most operators are either unary or binary. Unary operators form expressions on a single variable, but binary operators form expressions with two variables. Listing 2-2 demonstrates how unary operators are used.
Listing 2-2. Unary Operators: Unary.cs
using System;class Unary{    public static void Main()    {        int unary = 0;        int preIncrement;        int preDecrement;        int postIncrement;        int postDecrement;        int positive;        int negative;        sbyte bitNot;        bool logNot;        preIncrement = ++unary;        Console.WriteLine("pre-Increment: {0}", preIncrement);        preDecrement = --unary;        Console.WriteLine("pre-Decrement: {0}", preDecrement);        postDecrement = unary--;        Console.WriteLine("Post-Decrement: {0}", postDecrement);        postIncrement = unary++;        Console.WriteLine("Post-Increment: {0}", postIncrement);        Console.WriteLine("Final Value of Unary: {0}", unary);        positive = -postIncrement;        Console.WriteLine("Positive: {0}", positive);        negative = +postIncrement;        Console.WriteLine("Negative: {0}", negative);        bitNot = 0;        bitNot = (sbyte)(~bitNot);        Console.WriteLine("Bitwise Not: {0}", bitNot);        logNot = false;        logNot = !logNot;        Console.WriteLine("Logical Not: {0}", logNot);    }}
When evaluating expressions, post-increment (x++) and post-decrement (x--) operators return their current value and then apply the operators. However, when using pre-increment (++x) and pre-decrement (--x) operators, the operator is applied to the variable prior to returning the final value.
In Listing 2-2, the unary variable is initialized to zero. When the pre-increment (++x) operator is used, unary is incremented to 1 and the value 1 is assigned to the preIncrement variable. The pre-decrement (--x) operator turns unary back to a 0 and then assigns the value to the preDecrement variable.
When the post-decrement (x--) operator is used, the value of unary, 0, is placed into the postDecrement variable and then unary is decremented to -1. Next the post-increment (x++) operator moves the current value of unary, -1, to the postIncrement variable and then increments unary to 0.
The variable bitNot is initialized to 0 and the bitwise not (~) operator is applied. The bitwise not (~) operator flips the bits in the variable. In this case, the binary representation of 0, "00000000", was transformed into -1, "11111111".
While the (~) operator works by flipping bits, the logical negation operator (!) is a logical operator that works on bool values, changing true to false or false to true. In the case of the logNot variable in Listing 2-2, the value is initialized to false, and the next line applies the logical negation operator, (!), which returns true and reassigns the new value, true, to logNot. Essentially, it is toggling the value of the boolvariable, logNot.
The setting of positive is a little tricky. At the time that it is set, the postIncrement variable is equal to -1. Applying the minus (-) operator to a negative number results in a positive number, meaning thatpostitive will equal 1, instead of -1. The minus operator (-), which is not the same as the pre-decrement operator (--), doesn't change the value of postInc - it just applies a sign negation. The plus operator (+)doesn't affect the value of a number, assigning negative with the same value as postIncrement, -1.
Notice the expression (sbyte)(~bitNot). Any operation performed on types sbytebyteshort, or ushort return int values. To assign the result into the bitNot variable we had to use a cast, (Type), operator, where Type is the type you wish to convert to (in this case - sbyte). The cast operator is shown as the Unary operator, (T)x, in table 2-4. Cast operators must be performed explicity when you go from a larger type to a smaller type because of the potential for lost data. Generally speaking, assigning a smaller type to a larger type is no problem, since the larger type has room to hold the entire value. Also be aware of the dangers of casting between signed and unsigned types. You want to be sure to preserve the integrity of your data. Many basic programming texts contain good descriptions of bit representations of variables and the dangers of explicit casting.
Here's the output from the Listing 2-2:
pre-Increment: 1
pre-Decrement 0
Post-Decrement: 0
Post-Increment: -1
Final Value of Unary: 0
Positive: 1
Negative: -1
Bitwise Not: -1
Logical Not: true
In addition to unary operators, C# has binary operators that form expressions of two variables. Listing 2-3 shows how to use the binary operators.
Listing 2-3. Binary Operators: Binary.cs
using System;class Binary{    public static void Main()    {        int x, y, result;        float floatresult;        x = 7;        y = 5;        result = x+y;        Console.WriteLine("x+y: {0}", result);        result = x-y;        Console.WriteLine("x-y: {0}", result);        result = x*y;        Console.WriteLine("x*y: {0}", result);        result = x/y;        Console.WriteLine("x/y: {0}", result);        floatresult = (float)x/(float)y;        Console.WriteLine("x/y: {0}", floatresult);        result = x%y;        Console.WriteLine("x%y: {0}", result);        result += x;        Console.WriteLine("result+=x: {0}", result);    }}
And here's the output:
x+y: 12 
x-y: 2
x*y: 35
x/y: 1
x/y: 1.4
x%y: 2
result+=x: 9
Listing 2-3 shows several examples of binary operators. As you might expect, the results of addition (+), subtraction (-), multiplication (*), and division (/) produce the expected mathematical results.
The floatresult variable is a floating point type. We explicitly cast the integer variables x and y to calculate a floating point value.
There is also an example of the remainder(%) operator. It performs a division operation on two values and returns the remainder.
The last statement shows another form of the assignment with operation (+=) operator. Any time you use the assignment with operation operator, it is the same as applying the binary operator to both the left hand and right hand sides of the operator and putting the results into the left hand side. The example could have been written as result = result + x; and returned the same value.
                    

                                                                                     Next lesson-------->