Showing posts with label android. Show all posts
Showing posts with label android. Show all posts
Wednesday, 24 January 2018
Software development Life Cycle in Software Engineering
January 24, 2018
What is SDLC?
SDLC is a software development life cycle that based on different steps that are important to create any good software. Every software organization follows these steps to create an efficient software.
SDLC consists of four phases that are as follows:
1. Analysis
2. Design
3. Coding
4. Testing
Mistake in any phase will be leads to entire software error.
Let’s take an overview of these phases
Analysis
What is analysis?
Analysis is a process in which Analysis team finds what are the requirements of the customer. And they make sure that it is possible to fulfill all these requirements.
How analysis is used?
Analysis is the first part of SDLC. As analysis are the requirements and contract between customer and software organization, these requirements are important to create design of the software.
Where analysis is used?
Analysis is used in software designing and development. Designers first read analysis that helps them what to do and how to do.
Without analysis no Software design can be created.
Why analysis is used?
Analysis is used to find out what customer wants from software organization. Without analyzing customer requirements software will be leads to so much mistakes, that will cause problems between customer and software organization.
Design
What is designing??
Designing is a process of writing requirements of customer in diagram form. Diagrams can be of many types.
• Use case diagram
• Entity relationship diagram
• Class Diagram
• Data flow diagram
• And many others…
Why designing is important?
Designing is very important task in SDLC. Because programming needs proper information that can be understand by understanding diagrams.
How we can design diagrams?
We can create diagrams by using many softwares that are available in market. Some popular softwares are Microsoft visio and Star UML.
Where designing is used?
Programmer needs information to create any software. Programmer can’t write any software without information. Even if you want a software that can sum two numbers, then you have to tell the programmer. Programmers collect required information from the diagrams designed by designers.
Coding
What is coding?
A set of instructions given to the compiler to fulfill customer requirements is known as coding.
Coding is done by programmers. Programmers use different tools for coding like
• Dev C++
• Net beans IDE
• Java JDK
• Android Studio
• etc
Why coding is important?
Coding is the main part of SDLC. Because in this part actual software is created. In this part requirements are converted in software form.
How to code?
Coding need skills. Coding is done using different softwares like
• Java
• C++
• Ruby
• Python
Where coding is used?
Coding is used in software creation. No software can be created without coding. Coding can be done by using many languages like java C++ python and many other languages etc.
Testing
What is testing?
Testing is a process of checking software whether it fulfills customer requirements or not, whether it contains any further errors or not. If any error exits then it will be resolved.
How to test software?
Generally there are two methods of testing.
1. Dynamic
2. Static
Dynamic testing also called automatic testing. It is done using softwares like JUNIT and SELINIUM.
Static testing is manual testing and is done by source code of the software.
Why testing is important?
If we don’t test software and hand over it to customer then there may exits some problems likewise calculation problems. So in this case customer will be angry with you.
Where testing is used?
Software testing is used in reducing errors like output of the program that don’t fulfill the requirements of the customer. In this case testing will be used to remove these errors.
Wednesday, 10 January 2018
Decision making in programming language
January 10, 2018
In programming programs are written for multiple purposes and for multiple users.Each user's purpose of use may be different and definitely output should be
different.Decision making statements enable developers to write programs that can be used for multiple purposes.For example a person wanted to know whether
a specific number is even or odd?For that Program should be able to make decision against that number.Let's briefly discuss some decision making structures that are
available in programming languages.In decision making developer needs to test one or more conditions along with a statement or set of statements to be executed
if the tested condition is true,else other statements will be executed. These decision making statements are same in all languages but syntax may be little different.
An if can have zero or one else's and it must come after any else-if but mostly after last.
An if can have zero to many else if's and they must come before the else.
Once an if or else-if succeeds, none of the remaining conditions will be tested.
Syntax:
Syntax:
The syntax for a switch statement in programming language is as follows:
Let's take an example that display's country name based on 'id'. But this time instead of if-else-if switch statement will be used.
If statement
If is simplest decision making structure in programming.It produces the boolean result from provided condition or conditions.If boolean result is true then statements will be executed otherwise skipped.A disadvantage is that if condition is false then program will be ended without any output.The syntax of an if statement in programming is provided below.
if(condition or set of conditions)
{
Statements written here will be executed if expression or condition is true
}
Below is an example that will print some string if given condition is true.
#include <stdio.h>
#include <conio.h>
main ()
{
int a = 10;
if( a %2==0 )
{
//if condition is true then execute below statement
printf("Programming is GOOD" );
}
getch();
}
if-else statement
if-else statement works same like an if statement.An improvement over an if statement is that it contains else section that will be executed if provided condition is false.The syntax of an if-else statement in programming is provided below.
Let's take an example that will compare and display the greater number:if(condition or set of conditions) { Statements written here will be executed if expression or condition is true } else { Statements written here will be executed if above condition is false }
#include <stdio.h>
#include <conio.h>
main ()
{
int a = 10;
int b=50
if( a > b )
{
printf("a is greater then b" );
}
else
{
printf("b is greater then a" );
}
getch();
}
if-else-if statement
An if statement can be followed by an optional else-if else statement, which is very useful to test several conditions using single if-else-if statement.When using if , else-if , else statements there are few points to keep in mind:An if can have zero or one else's and it must come after any else-if but mostly after last.
An if can have zero to many else if's and they must come before the else.
Once an if or else-if succeeds, none of the remaining conditions will be tested.
Syntax:
if(condition or set of conditions)
{
Statements written here will be executed if expression or condition is true
}
else if(condition or set of conditions)
{
Statements written here will be executed if expression or condition is true
}
else if(condition or set of conditions)
{
Statements written here will be executed if expression or condition is true
}
else if(condition or set of conditions)
{
Statements written here will be executed if expression or condition is true
}
else
{
Statements written here will be executed if none of the above conditions is true
}
Let's take an example that will display grade based on student marks:
#include <stdio.h>
#include <conio.h>
main ()
{
int marks=45;
if( marks>=80 )
{
printf("A grade");
}
else if( marks>=60)
{
printf("B grade");
}
else if( marks>=40 )
{
printf("C grade");
}
else
{
printf("F grade");
}
getch();
}
After the compilation "C grade" will be printed on screen.Switch structure
A switch was introduced as a best alternative of if-else-if statement.A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.Syntax:
The syntax for a switch statement in programming language is as follows:
switch(variable or expressin){
case constant-value :
// statements here
break;
case constant-value :
// statements here
break;
default : /Optional but good for efficient working
// statements here
}
break:
Break is a keyword in programming that is used in loops or switch statement to terminate current iteration.In switch break keyword is used to skip the remaining cases when a specific condition becomes true.Otherwise remaining statements will be executed automatically.Let's take an example that display's country name based on 'id'. But this time instead of if-else-if switch statement will be used.
#include <stdio.h>
#include <conio.h>
main ()
{
int id=2;
switch(id)
{
case 1 :
printf("China" );
break;
case 2 :
printf("Saudi Arabia" );
break;
case 3 :
printf("Pakistan" );
break;
case 4 :
printf("United states" );
break;
case 5 :
printf("India" );
break;
default :
printf("Invalid id" );
}
getch();
}
Nested Structures
A structure within a structure is known as nested structure or nested statement.if-esle-if statement and switch statement can also be nested.It means we can use the same code to test another inner condition.But it makes program difficult to understand so always use nested statements with carefully.Now we will see an example that will use nested if statement to find out whether all three variables are equal or not.
#include <stdio.h>
#include <conio.h>
main ()
{
int a = 100;
int b = 100
int c = 100;
if( a == b )
{
if( b == c )
{
printf("All variables are equal" );
}
}
else
printf("All variables are not equal");
getch();
}
Now we will check the same example using nested switch statement.
#include <stdio.h>
#include <conio.h>
main ()
{
int a = 100;
int b = 100;
switch(a) {
case 100:
switch(b) {
case 100
printf("Both variables are equal");
break;
default:
printf("Both variabkes are not equal" );
}
}
getch();
}
Tuesday, 9 January 2018
Table application in android for kids
January 09, 2018
Android table application is very basic app for small children.It will help them to learn tables.It consists of simple input area where integer values can be entered up-to 32700.User just need to input the number of table and press the 'ok' button.Instantly required table will be displayed to the user.Many people might be thinking that its just a foolish app.But I have analyzed that new generation spends maximum time on smartphones.If they have a smartphone with no time wasting games and some knowledge related applications are preinstalled like table, so I think it will be more beneficial.So paste the source code given below into your project and provide your children a bright future.
AndroidManifest.xml
MainActivity.java
activity_main.xml
Output
AndroidManifest.xml
MainActivity.java
activity_main.xml
Output
Subscribe to:
Posts (Atom)