Sunday, October 13, 2019

Sum of Odd and Even Numbers Algorithms, Pseudocode and Flowcharts



Programming Problem

Write an algorithm and pseudocode, draw a flowchart that takes the number N, find the sum of odd and even numbers from 1 to N, and display the result on the screen.

Algorithm
                                                                                         
Step 1: Start                                                                                     
Step 2: Declare variables i, num, oddsum
             Declare variable evensum
Step 3: Input a value say num
Step 4: FOR i = 1 TO num
                 IF i % 2 = 0
       evensum = evensum + i
    ELSE
        oddsum = oddsum + i
       ENDIF
 DONE
Step 5: Display evensum
            Display oddsum
Step 6: Stop

Pseudocode

Start
    Declare Integer i, num, oddsum, evensum
    Assign oddsum = 0
    Assign evensum = 0
    Output "Sum of Odd and Even Numbers"
    Output "Give the value of num :"
    Input num
    For i = 1 to num
        If i % 2 = 0
            Assign evensum = evensum + i
        False:
            Assign oddsum = oddsum + i
        End
    End
    Output "Sum of all even numbers  = " & evensum &"."
    Output "Sum of all odd numbers  = " & oddsum &"."
End
Stop


Flowchart of Sum of Odd and Even Number


 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.

Factorial Number Algorithms,Pseudocodes and Flowcharts


Programming Problem

Write an algorithm and pseudocode, draw a flowchart to ask the user to give a number and then, it will compute the factorial value of the given number and display the result on the screen.

Algorithm 
                                                                                         
Step 1:  Start
Step 2:  Declare variables a,f,i
Step 3:  Input Give a Number say a
Step 4:  Initialize f = 1
             Initialize i = 1
Step 5: WHILE i <= a
                f = f * i
               i = i + 1
            END
Step 6: Display f
Stop 7: Stop

Pseudocode

Start:
    Declare Integer a, f, i
    Output "Factorial Solver"
    Output "Give a Number:"
    Input a
    Assign f = 1
    Assign i = 1
    While i <= a
        Assign f = f * i
        Assign i = i + 1
    End
    Output "Factorial : " & f & "."
Stop:




I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.

Count the Number of Digits Algorithms, Pseudocode and Flowchart


Programming Problem

Write an algorithm and pseudocode, draw a flowchart to count the number of digits in the given integer, and display the result on the screen.

Algorithm                                                                                          
Step 1: Start
Step 2: Declare variables n,count
Step 3: Input enter an integer says n
Step 4: WHILE n != 0
                n = n / 10
               count = count + 1
            END
Step 5: Display count
Step 6: Stop

Pseudocode
Start:
    Declare Integer n, count
     Assign count = 0
    Output "Enter an integer:"
    Input n
    While n != 0
        Assign n = n/10
        Assign count = count + 1
    End
    Output "Number of digits is  " &count &"."
Stop:





I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.



HTML and CSS Navigational Menu for ABC Computers Sales and Services

A simple HTML and CSS Navigational Menu for ABC Computers Sales and Services website template that I wrote a long time ago in my class in web design and development. I hope you will find my work useful in learning HTML and CSS.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.



Apple Logo



Sample Program Output


Program Listing

index.htm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>ABC Computer Sales and Services</title>
            
    <style type="text/css">
body { margin: 0; padding: 0; }
a, a:hover, a:active, a:visited, a:visited:hover { text-decoration: none; border: none; outline: none; }
div.nav {
margin: 18px auto 0px auto;
border-width: 1px 1px 1px 1px;
border-style: solid;
border-color: #fff #dfdfdf #dfdfdf #dfdfdf;
border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
/*-moz-box-shadow: 0px 1px 2px #ccc;*/
display: table;
}
div.nav ul {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
border-width: 0px 0px 1px 0px;
border-style: solid;
border-color: #9f9f9f;
border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
-webkit-border-radius: 5px 5px 5px 5px;
background: -webkit-gradient(linear, left top, left bottom, from(#b3b3b3), to(#6e6e6e));
background: -moz-linear-gradient(top,  #b3b3b3,  #6e6e6e);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b3b3b3', endColorstr='#6e6e6e');
display: inline-block;
list-style: none;
}
div.nav ul li {
margin: 0px 1px 0px 0px;
padding: 0px 0px 0px 0px;
background: -webkit-gradient(linear, left top, left bottom, from(#cecece), to(#8c8c8c));
background: -moz-linear-gradient(top,  #cecece,  #8c8c8c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cecece', endColorstr='#8c8c8c');
float: left;
}
div.nav ul li:first-child {
border-radius: 5px 0px 0px 5px;
-moz-border-radius: 5px 0px 0px 5px;
-webkit-border-radius: 5px 0px 0px 5px;
}
div.nav ul li:last-child {
margin-right: 0px !important;
border-radius: 0px 5px 5px 0px;
-moz-border-radius: 0px 5px 5px 0px;
-webkit-border-radius: 0px 5px 5px 0px;
}
div.nav ul li a {
margin: 0px 1px 0px 1px;
padding: 11px 33px 11px 33px;
background: -webkit-gradient(linear, left top, left bottom, from(#cacaca), to(#848484));
background: -moz-linear-gradient(top,  #cacaca,  #848484);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cacaca', endColorstr='#848484');
float: left;
/*-*/
font-family: Lucida Sans, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #252525;
text-shadow: #cecece 0px 1px 0px;
}
div.nav ul li:first-child a {
border-radius: 5px 0px 0px 5px;
-moz-border-radius: 5px 0px 0px 5px;
-webkit-border-radius: 5px 0px 0px 5px;
}
div.nav ul li:last-child a {
margin-right: 0px !important;
border-radius: 0px 5px 5px 0px;
-moz-border-radius: 0px 5px 5px 0px;
-webkit-border-radius: 0px 5px 5px 0px;
}
div.nav ul li:hover {
background: -webkit-gradient(linear, left top, left bottom, from(#999999), to(#5f5f5f));
background: -moz-linear-gradient(top,  #999999,  #5f5f5f);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#999999', endColorstr='#5f5f5f');
}
div.nav ul li:hover a {
padding: 11px 33px 11px 33px;
background: -webkit-gradient(linear, left top, left bottom, from(#929292), to(#535353));
background: -moz-linear-gradient(top,  #929292,  #535353);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#929292', endColorstr='#535353');
/*-*/
color: #fff;
text-shadow: #454545 0px -1px 1px;
}
div.nav ul li:active {
background: -webkit-gradient(linear, left top, left bottom, from(#242424), to(#3f3f3f));
background: -moz-linear-gradient(top,  #242424,  #3f3f3f);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#242424', endColorstr='#3f3f3f');
}
div.nav ul li:active a {
margin: 0px 0px 0px 0px;
padding: 9px 33px 11px 33px;
border-width: 2px 1px 0px 1px;
border-style: solid;
border-color: #282928 #3f3f3f #525051 #3f3f3f;
-webkit-box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255, 255, 255, .1);
-moz-box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .05), inset 0 2px 5px #363636, inset 0 0 0 1px rgba(255, 255, 255, .1);
background: -webkit-gradient(linear, left top, left bottom, from(#999999), to(#5f5f5f));
background: -moz-linear-gradient(top,  #999999,  #5f5f5f);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#999999', endColorstr='#5f5f5f');
color: #fff;
text-shadow: #454545 0px -1px 1px;
}
div.nav ul li:last-child:active a {
padding-right: 34px;
}
div.nav ul li.selected {
background: -webkit-gradient(linear, left top, left bottom, from(#242424), to(#3f3f3f));
background: -moz-linear-gradient(top,  #242424,  #3f3f3f);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#242424', endColorstr='#3f3f3f');
}
div.nav ul li.selected a {
margin: 0px 0px 0px 0px;
padding: 9px 33px 11px 33px;
border-width: 2px 1px 0px 1px;
border-style: solid;
border-color: #282928 #3f3f3f #525051 #3f3f3f;
background: -webkit-gradient(linear, left top, left bottom, from(#373837), to(#525051));
background: -moz-linear-gradient(top,  #373837,  #525051);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#373837', endColorstr='#525051');
/*-*/
color: #fff;
text-shadow: #454545 0px -1px 1px;
}
div.nav ul li.selected:last-child a {
padding-right: 34px;
}
/*-----*/
div.nav ul li.logo a {
padding: 5px 34px 7px 34px;
}
div.nav ul li.logo:active a {
padding: 5px 35px 7px 35px;
border: none;
}
div.nav ul li.logo a img { width: 24px; height: 24px; }
/*-----*/
div.nav ul li.search a {
padding: 8px 9px 9px 7px;
}
div.nav ul li.search a input {
width: 120px;
height: 17px;
padding: 0px 0px 0px 20px;
border-width: 1px 1px 1px 1px;
border-style: solid;
border-color: #888 #b0b0b0 #dedede #b0b0b0;
border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
-webkit-border-radius: 10px 10px 10px 10px;
background: #fff url(button_search.png) no-repeat 5px 3px;
/*-*/
font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif;
font-size: 11px;
color: #7e7e7e;
}
div.nav ul li.search:hover, div.nav ul li.search:active {
background: -webkit-gradient(linear, left top, left bottom, from(#cecece), to(#8c8c8c));
background: -moz-linear-gradient(top,  #cecece,  #8c8c8c);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cecece', endColorstr='#8c8c8c');
}
div.nav ul li.search:hover a, div.nav ul li.search:active a {
margin: 0px 1px 0px 1px;
border: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
background: -webkit-gradient(linear, left top, left bottom, from(#cacaca), to(#848484));
background: -moz-linear-gradient(top,  #cacaca,  #848484);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cacaca', endColorstr='#848484');
}
div.nav ul li.search:active a {
padding: 8px 9px 9px 7px;
}
    
    </style>

</head>

<body>
   <h1> <center> <font color="light blue">
   ABC Computer Sales and Services </center> </h1> </font>

<div class="nav">
    <ul>
        <li class="logo"><a href="#"><img src="logo_apple.png" border="0" /></a></li>
        <li><a href="#">About US</a></li>
        <li><a href="#">History</a></li>
        <li><a href="#">Products</a></li>
        <li><a href="#">Services</a></li>

       
       
        </ul>
    </div>

</body>

</html>


Shell Sorting Program in C

In this article I will share to you guys a shell sort program that I wrote using C programming language. I am using Dev C++ as my C++ compiler in writing this program.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod City I also accepting computer repair, networking and Arduino Project development at a very affordable price.



Sample Program Output


Program Lisiting

/* shell_sort.c
   Author   : Mr. Jake Rodriguez Pomperada,BSCS,MAED-IT
   Tool     : Dev C++ 5.11
   Date     : April 18, 2019  Thursday   10:53 AM
   Website  : www.jakerpomperada.com
   Email    : jake_pomperada@tup.edu.ph and jakerpomperada@gmail.com
   Location : Bacolod City, Negros Occidental
*/

#include <stdio.h>
#include <stdlib.h>

void shellsort(int arr[], int num);

int main()
{
 int items[1000], num=0,min=0,loc=0;
 int c=0, b=0,change=0,j=0,temp=0;
 system("cls");
 printf("\n\n");
 printf("\tShell Sort Program in C");
 printf("\n\n");
 printf("\tHow many items? : ");
 scanf("%d", &num);
 printf("\n\n");
 for (c= 0; c < num; c++) {
    printf("\tEnter item no. %d: ", c+1);
    scanf("%d", &items[c]);
 }
printf("\n\n");
printf("\tOriginal Arrangement of Numbers");
printf("\n\n");
 for ( c = 0 ; c < num ; c++ ) {
   printf("\t%d ",items[c]);
 }
 shellsort(items, num);
 printf("\n\n");
 printf("\tAsceding Order of Numbers");
 printf("\n\n");
 for ( c = 0 ; c < num ; c++ ) {
 printf("\t%d ", items[c]);
 }  
printf("\n\n");
printf("\tEnd of Program");
printf("\n\n");
system("pause");
}

void shellsort(int arr[], int num)
{
    int i, j, k, tmp;
    for (i = num / 2; i > 0; i = i / 2)
    {
        for (j = i; j < num; j++)
        {
            for(k = j - i; k >= 0; k = k - i)
            {
                if (arr[k+i] >= arr[k])
                    break;
                else
                {
                    tmp = arr[k];
                    arr[k] = arr[k+i];
                    arr[k+i] = tmp;
                }
            }
        }
    }
}




Introduction To JavaScript Language


INTRODUCTION TO JAVASCRIPT
·          JavaScript is a web enhancing language through which we can change a stand-alone page of content into an engaging, interactive and intelligence experience
·          Developed by Netscape Corporation
·          Initially known as “Live Script”
·          JavaScript was also referred to, as ECMA Script. (European Computer Manufacturer’s Association)

JAVA VS. JAVASCRIPT
Java:
·          Purely an object-oriented language
·          Compiled and the resultant byte code is executed
·          Strongly typed (declared variable cannot hold other data type value)
·          Object references must exists at compile time (static binding)

JavaScript:
·          Object-Based Scripting Language
·          The client (browsers) directly interpret code
·          Freely typed (any variable can hold any data type value)
·          Object references are checked only at runtime (dynamic binding)

JAVASCRIPT CHARACTERISTICS AND ADVANTAGES
  • ·          Object-based Technology
  • ·          Platform Independent
  • ·          Based on an event-driven model
  • ·          Control Frame navigation
  • ·          Include a plug-in or Java applet inside a page
  • ·          Validate HTML submission forms
  • ·          “Easy to Learn”


ENABLING JAVASCRIPT IN A BROWSER

MSIE:
Tools menu > Internet Options from Internet Options window > Security tab > Custom Level button Enable every setting for Scripting to allow JavaScript pages

Mozilla Firefox:
Tools menu > Options Options window > Content button Select Enable JavaScript checkbox

OUR FIRST JAVASCRIPT PROGRAM
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<SCRIPT TYPE = “text/javascript”>
document.write(“Hello World”);
</BODY>
</HTML>

HOW TO WRITE JAVASCRIPT
·          Codes are enclosed in
o    <SCRIPT>...</SCRIPT> pair of tags
·          Attributes
o    SRC
o    TYPE
o    LANGUAGE
·          Guidelines in writing JavaScript
o    Case sensitive
o    Ignores Whitespaces
o    Breakup a code line
o    Use semicolon