Sunday, November 3, 2013

Module VII & VIII

Description of Module 7 and 8 

http://youtu.be/Ui1dpL6u0Gc (Module VII & VIII video tutorial)


This application program  have consist with variable, operator, control  flow, function, array and link list that write in c programming in visual studio 2012.
I would like to brief describe with the process of code that consist with variable, operator,  control  flow, function, array and link list relate with how to call the variable name to copy string , define array in data type of variable, use pointer function with link list, putting condition to pointer and link list condition.
Please look the flowchart that describes about the process of the application program in below:
Description the process of code that have command for detail of code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define RECORDS 6 // declaration global variable
main( )
struct animal {
       char name[25]; /* declaration data type of variable of the animals name */
       char breed[25]; /* The type of animal */
       struct animal *next; /* a pointer to another record of this type */
}
*point, *start, *prior; /* this defines 3 pointers, no variables */
int index;  /* the first record is always a special case */
start = (struct animal *)malloc(sizeof(struct animal));
strcpy(start ->name,"general"); // copying string
strcpy(start ->breed,"Mixed Breed");
start->next = NULL;
prior = start;/* a loop can be used to fill in the rest once it is started */
for (index = 0;index < RECORDS;index++) {
              point = (struct animal *)malloc(sizeof(struct animal));
              strcpy(point->name,"Frank");
              strcpy(point->breed,"Laborador Retriever"); //point->age = 3;
              point->next = point;/* point last "next" to this record */
              point->next = NULL; /* point this "next" to NULL */
              prior = point; /* this is now the prior record */
}/* now print out the data described above */
point = start;
do {
prior = point->next;
printf("%s is a %s,and is %s\n", point->name, point->breed, point->breed);
point = point->next;
} while (prior != NULL);/* good programming practice dictates that we free up the */
/* dynamically allocated space before we quit */
point = start; /* first block of group */
do {
              prior = point->next; /* next block of data */
              free(point); /* free present block */
              point = prior; /* point to next */
              } while (prior != NULL); /* quit when next is NULL */
       system ("pause");
       return 0;
}
Please look the output result of code in below:


Saturday, October 26, 2013

Module VI

 Module VI
http://youtu.be/5qvt7oRMi80(Video Module VI)
In this code, it would like show you also use pointer with input data (scanf) by was defined by , array function, looping condition, and pointer function. For example in this code :
printf ("Type the siblings age you\n") ; for (k = 0; k<jml_sak; k++) { printf ("#%d ", k+1); // your looping condition depend of your inputting scanf ("%d", & age[k]); this code that expression that you input data with pointer function is:
printf ("Type the number of siblings you>"); scanf("%d",&jml_sak); // you can input your data use with pointer function.
The code show you about how show your sibling age by using array, looping condition, and pointer function.
Please look the flowchart of Module VI that consist with variable, operator, control flow, function, array, and pointer function.

Please look the code in below:
 #include <stdio.h>
 #include <stdlib.h>
#include <string.h>
 int main(void) {
int *age; // Declare array with pointers
 int jml_sak, k = 0;
printf ("Type the number of siblings you>");
 scanf("%d",&jml_sak);
age = (int*) malloc (sizeof (int) *jml_sak); //dynamic memory allocation
if (!age)
 {
printf ("Memory not available!\n");
system ("pause");
 return 0;
} /* input data is age */
 printf ("Type the siblings age you\n") ;
 for (k = 0; k<jml_sak; k++)
{
printf ("#%d ", k+1);
 scanf ("%d", & age[k]); } /* display the age data */
printf ("The data you input earlier age:\n");
for (k = 0; k<jml_sak; k++)
printf ("#%d %d\n", k+1,age[k]); /* download dealokasikan dynamic memory */
free (age);
 age = NULL;
 system ("pause");
return 0;
}


Saturday, October 19, 2013

Module IV



The introduction consist with variable, operator, control flow , and function in C program for using Visual Studio 2012
            http://youtu.be/H274cy2Mpjg (video how to create code in C in Visual studio 2012 consist with variable, operator, control flow , and function (mathemathic function))
This is a time for me to introduce about how to right code in C program for Visual Studio 2012 that consist variable, operator, control flow, and function. The function for this introduction, I will chose the Math.h function that all consist with variable , operator, control and function. Moreover, in this code I will include the global declaration variable and some syntax relate with mathematic function.
            Then, in this below, it is a flowchart of how to process of the code in C that consist with variable, operator, control flow, and function relate with math.h function.




















 The last, is the code of the these introduction. Please look the code in below:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
voidconisius(float m);
void sinus(float m);
voidtangen(float m);
floatm,b,h;
int s;
int main(void)
{
            repeat:
            printf("Knowing the function Math.h in C\n");
            printf("____________________________________\n");
            printf("1. conisiuus\n");
            printf("2. sinus\n");
            printf("3. tangen\n");
            printf("_____________________________________\n");
            printf("Input your selection >> ");
            scanf_s("%i",&s);
            if(s==1)
            {
                        conisius(m);
            }
            else if(s==2)
            {
                        sinus(m);
            }
            else if(s==3)
            {
                        tangen(m);
            }
            else
            {
                        printf("Input selection from 1 to 3\n");
                        goto repeat;
            }
            system("pause");
            return(0);
}
voidconisius(float m)
{
            printf("Your choice function Conisius\n");
            printf("_________________________________\n");
            printf("Input numeral >>");
            scanf_s("%.2f",&m);
            h = cos(m);
            printf("Cos from %f >> %f",h);
}
void sinus(float m)
{
            printf("Your choice function Sinus\n");
            printf("_________________________________\n");
            printf("Input numeral >>");scanf_s("%f",&m);
            h = sin(m);
            printf("Sinus from %f >> %.2f \n",,h);
}
voidtangen(float m)
{
            printf("Your choice function Tangen\n");
            printf("________________________________\n");
            printf("Input numeral >>");scanf_s("%f",&m);
            h = tan(m);
            printf("Pangkat from %f >> %.2f",,h);
}


eeff

Tuesday, October 15, 2013

Module I,II,III

http://youtu.be/4VRJSkfRcJI (how to create c pro in Visual Stadio)
http://youtu.be/Yn1a2fcuB9s (how to use Camstadio)
How to process flowchart with c program
This time I will post about my exercises of course TMD02 from this exercise i must create a simple application using C programming with using Visual Studio 2012.
Actually, there is application that I created by myself that using C programming.
Moreover, in this exercise we must create just simple application that include variable, operator and control flow.
As a result, it is the time I create currency converter program.
The picture below is the how to process of flowchart for calculation triangle pyramid ball and sphere:


Code : 
#include 
#include 
int main(void)
{
int a;
float b,h1,h2,v,pi= 3.14159,r;
do{
printf("Please input value =");
scanf_s("%d",&a);
switch (a){
case 1: 
printf("Calclator the valume of triangle pyramid ball : \n");
printf("please input value of base bottom = ");
scanf_s ("%f",&b);
printf("please input value of base height =");
scanf_s ("%f",&h1);
printf("please input value of base pyramid height =");
scanf_s ("%f",&h2);
v = (((b*h1)/2)*h2/3);
printf ("The value of triangle pyramid ball is = %f \n ",v);
break;
case 2:
printf(" calculte valume of sphere ");
printf("Please input value of radius = \n");
scanf_s("%f",&r);
v = ((pi*r*r*r)*4)/3;
printf("value of sphere is =%f \n",v);
break;
default:
printf("You do not type number 1 or 2 please input your value again");
break;
}
}while ((a != 1)&&(a != 2));
system("pause");
return 0;
}