Showing posts with label lida chea. Show all posts
Showing posts with label lida chea. Show all posts

Friday, November 2, 2012

Tugas V-1

Name: Chea Lida
Major:TMD

1. Create the program to insert n integer value in the array and then to returned data array, the total number and average them!


#include <stdlib.h>//Accessing library stdio.h's file parse it exists printf's function()
#include <stdio.h>//Accessing library stdlib.h's file parse it exists system's function( "pause")

int main()//main's function that shall there
{
       int num[10];//declare array num that content 10 character
       int count = 0, k;
       float total = 0;
       printf("Enter the amount of data you want: (1 - 10)\n");//display text Enter the amount of data you want
      
       while(count <= 0 || count > 10){//looping start if count<=0 or count >10
              scanf("%d", &count);// accepting input from user keep it in variable count
       }
      
       for(k = 0; k < count; k++){// looping start k=0 end k < count and step k++
              printf("\nEnter %d amount : ", k+1); //display k+1
              scanf("%d", &num[k]); // accepting input from user keep it in variable num
       }

       for(k = 0; k < count; k++){// looping start k=0 end k < count and step k++
              printf("\nData %d that u have been insert : %d", k+1, num[k]); //display k+1 and num[k]
              total = total + num[k]; //calculate total
       }

       printf("\n\nTotal amount that have insert : %.0f\n", total);//display total
       printf("Average amount all the data you insert: %.3f\n", total/count); // display total/count

       system("pause");
}




Tuesday, October 30, 2012

Temperature convertion

Name: Chea Lida
Major: TMD

/*Make program for converts temperature from Celsius goes to Fahrenheit to go to kelvin */
#include <stdio.h>
//Accessing library stdio.h's file parse it exists printf's function() and scanf()

#include <stdlib.h>
//Accessing library stdlib.h's file parse it exists system's function( "pause")

int main(void){//main's function that shall there is

       int c, F,K;//variable declaration
       printf("Temperature entry in Celsius : ");
       scanf("%d",&c);//accepting input from user
        and keep into variable c
       system("cls");//clear screen
       printf("Program Converse temperature \n");
       printf ("Temperature in Celsius is   %d C\n",c);
        //display Temperature in Celsius from              input
       F = c * 1.8 + 32;//formula for convert to fahrenheit
       printf ("Temperature in Fahrenheit is  = %d K\n",F);
    //display Temperature in fahrenheit from              convertion
       K = c + 273;//formula for convert from celsius to kelvin
       printf ("Temperature in kelvin is  = %d C\n",K);
    //display Temperature in fahrenheit from              convertion
       system("pause");
       return 0;   
}



http://www.youtube.com/watch?v=vIWs5ZIsKWE&feature=youtu.be

Saturday, October 27, 2012

Calculation Volume of Trangular Pyramid and Volume sphere

Name :Chea Lida
Major: TMD




http://www.youtube.com/watch?v=pOPw2W8jzy0&feature=youtu.be




#include<stdio.h>
#include<stdlib.h>
int main()
{
    int i ;
    float b, h1,h2,v;
    float r ,pi=3.14159;
    do
    {
    printf("Please input number 1 to Calculate Volume of triangular pyramid and number 2 to calculate Volume of sphere:\n");
    scanf_s("%d",&i);//include value i from keyboard
        switch(i)
        {
            case 1://if value equal 1, statement in case 1 execute
                printf("calculate the volume of triangular pyramid \n ");
                printf("Enter Base:");
                scanf_s("%f",&b);
                printf("Enter height of triangular:");
                scanf_s("%f",&h1);
                printf("Enter height of Pyramid:");
                scanf_s("%f",&h2);
                v=(((b*h1)/2)*h2)/3;//formula for calculate Volume of triangular pyramid
                printf("The volume of triangular pyramid is: %f \n",v);
                break;
            case 2://if value equal 2, statement in case 2 execute
                printf("calculate the volume of sphere \n ");
                printf("Enter radius:");
                scanf_s("%f",&r);
                v=(4/3)*pi*(r*r*r);//formula for calculate Volume of sphere
                printf("The volume of sphere is: %f \n",v);
                break;
            default:
                printf("you do not type a number 1 or 2\n\n");
                break;

        }
    }while((i!=1)&&(i!=2));//if inputing of i differance to 1 and 2 must input again
    system("pause");
    return(0);













Thursday, October 25, 2012

Tugas II operation

Name: Chea Lida
Major: TMD

Define the calculation operations below. Make analysis / explanation in the form of
comments in the code.

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

int main(void)
{
    int i=8,j=5,k;// declare variable
    k=(3*i-2*j)%(2*j-4);

    /*it calculate value in peranthesis first and
    multiplicate symbol * is a symbol for calculate first and
    then subtract
    k=(3*i-2*j)%(2*j-4)
    =((3*8)-(2*5))%((2*5)-4)
    =(24-10)%(10-4)
    =14%6
    =2
    */

    printf("k=(3*i-2*j)%(2*j-4)= %d \n",k); //
    system("pause");
    return(0);
}

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

int main(void)
{
    int i=8,j=5,k;// declare variable
    k=-(i + j ) ;
    printf("k=-(i + j )= %d \n",k);
        /*k=-(i + j )
           =>-(i+j)=-i-j
           =-8-5
           =-13*/
    system("pause");
    return(0);
}

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

int main(void)
{
    int i=8;// declare variable
    for(i;i<10;i++){
    printf("k= %d \n",i);
    /*mean that i catch declared value first then take declared
    value add 1 until finish condition*/
   
    }
    system("pause");
    return(0);
}
4
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    int i=8;// declare variable
    for(i;i<10;++i){
    printf("k= %d \n",++i);
    /*mean that i catch the value i=8 add 1 until finish condition
    i=i+1
    */
   
    }
    system("pause");
    return(0);
}
5
int main(void)
{
    float x=0.005;// declare variable
    printf("x=%f \n",++x);
    //mean that x catch declared value add 1
   
    system("pause");
    return(0);
}

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

int main(void)
{
    int i=8,j=5,k;// declare variable
    k=(i > 0)|| (j < 5);
    printf("i or j ( 1 = true, 0 = false):%d\n",k);
    /*if which is ture mean that true =1 but both of it false mean
    that false =0*/
   
    system("pause");
    return(0);
}
 7
#include<stdio.h>
#include<stdlib.h>

int main(void)
{
    float x=0.005, z;// declare variable
    z = ( x >= 0) ? x : 0;
    //if it true z=x and false = 0
    printf("if true=0.005 and wrong= 0 \n=%f\n",z);
    system("pause");
    return(0);
}

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

int main(void)
{   
    int i=8,j=5,k;// declare variable
    k= (i + j );
    //i=8 and j=5 =>8+5=13
    printf("k = (i + j ):%d\n",k);
    system("pause");
    return(0);
}

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

int main(void)
{

    float x=0.005,y=-0.01, z;// declare variable
    z = (2 * x + y) == 0;
    printf("if true =1 false=0\n=%.f\n",z);
    /*z=0  because operation in (2 * x + y)  symbol multiplicate do
     first so 2*0.005+(-0.01)=0 is true*/
    system("pause");
    return(0);
}

10

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

int main(void)
{
    int i=8,j=5,k;// declare variable
    k=(i > 0)|| (j < 5);
    printf("i or j ( 1 = true, 0 = false):%d\n",k);
    /*if which is ture mean that true =1 but both of it
     false mean that false =0*/
   
    system("pause");
    return(0);
}

 



Tuesday, October 23, 2012

Calculation area of Trapezium

Name: Chea Lida
Major: TMD

#include <stdio.h> // stdio.h is the name of library that include printf and scanf function
#include <stdlib.h> //stdlib.h is the name of library that include system ("pause") function
int main(void) // Function who shall there is on each program c
{
    float a; // for small bottom of Trapezium
    float b; // for big bottom of Trapezium
    float h; // for height of Trapezium
    float area; // for area of Trapezium
   
    printf (" Please input small bottom of Trapezium: \n");
    scanf("%f",&a);
    printf ("Please input big bottom of Trapezium: \n");
    scanf("%f",&b);
    printf ("Please input height of Trapezium:");
    scanf ("%f",&h);
    area = ((a+b)*h)/2;
    printf ("Area of Trapezium is= %d\n",area);
    system("pause"); //to pause a program and wait for a keyboard input to continue.

}




http://www.youtube.com/watch?v=wBucl_jQJJk&feature=youtu.be


How to printf Hello World !

Name: Chea Lida
Major: TMD

#include <stdio.h> //stdio.h is the name of library that include printf and scanf function
#include <stdlib.h>  //stdlib.h is the name of  library that include system ("pause") function
int main(void) // Function who shall there is on each program c
{
        printf("Hello World!\n"); //use for send output to screen
        system("pause"); //to pause a program and wait for a keyboard input to continue.

}


http://www.youtube.com/watch?v=wlZLO3juiZ8&feature=youtu.be

Monday, October 22, 2012

How to record screen by Camstudio

Name: Chea Lida
Major: TMD D4 ITB Batch 6


========
Software:
CamStudio dan XVid Video Codec

========
--Format Video--

REGION
1. Fixed Region
> unchecked "Fixed Top-Left Corner" & "Drag Corners to Pan"
> Resolusi: Width x Height = 426 x 240

OPTIONS
1. Video Options
> Compresor: Xvid MPEG-4 Codec
> Compressor -> Configure -> Other options -> Encoder -> Unchecked "Display encoding status"
> Uncheck: Auto Adjust
> Set Key Frames Every = 20 frames
> Capture Frame Every = 50 milliseconds
> Playback Rate = 20 frames/second
2. Cursor Options
> Cursor Display #
> Cursor Highlight #
3. Audio Options for Microphone
> Audio Capture #
> Recording Format -> 11.025 kHz, mono, 8-bit
> Interleave every: 100 Milliseconds
> Unchecked "Use MCI Recording"
4. Pilih: Record audio from microphne
5. Pilih: Enable Autopan

TOOLS
1. Pilih: Video Annotations
> Klik Kanan -> Video Format -> Resolution = 160 x 120
> Klik Kanan -> Edit Text: kosongkan/ hapus teks yang tertulis