Showing posts with label Struct. Show all posts
Showing posts with label Struct. Show all posts

Monday, November 5, 2012

how to use c programming for show date tomorrow

Dear Lecturer
Name: Him Seanghon
Mayor: D4 TMD Batch6


This is my video for complete Tugas VI from youtube



This is my link:  http://youtu.be/qJuAkwoLeGY

Thanks.

Perhitungan Tanggal Esok Hari

 Berikut Video Tugas Modul 6 Nomer 2 - Perhitungan Tanggal Esok Hari

Nama : Ravita Eka Dewi



Fungsi Struct dalam Pemrograman C

Menggunakan fungsi struct pada pemrograman C. Berikut videonya :


Array 2 Dimensi dan Structure pada Bahasa C (Tanggal Esok)

Pada kesempatan kali ini akan dibahas mengenai Array 2 Dimensi dan Structure pada Bahasa C. Array adalah sekelompok data yang disimpan berdasarkan index. Array 2 Dimensi merupakan array yang menyusun data array didalamnya, sehingga membentuk array di dalam elemen array utama. Stucture merupakan sebuah tipe data yang memiliki cakupan tipe data yang lain. Stucture hampir seperti tipe data yang telah kita buat sendiri. Pada video, akan dijelaskan mengenai deklarasi Structure dan implementasi Structure (input-output) serta deklarasi Array 2 Dimensi dan implementasinya.


Array 2 Dimensi, Pointer dan Struktur

Berikut ini saya akan membahas tentang Tugas VI soal no 2 yaitu menentukan tanggal untuk hari esok. Pada program ini meminta inputan dari user berupa tanggal hari ini. Kemudian disimpan pada sebuah struktur yang terdiri dari hari, bulan dan tahun. Kemudian menggunakan array 2 dimensi yang berisikan jumlah hari dalam satu bulan. Karena jumlah hari dalam satu bulan berbeda-beda, maka digunakanlah array untuk menentukannya. Berikut video tutorialnya :


Sunday, November 4, 2012

C Structure insert ten student data

NAME: TEP SENGHAK
UNIVERSITY: D4 ITB BATCH 6
EDUCATION MAJOR: TMD

This is a source code about a program which can be used to insert student's information. The user can insert ten students only. The information about the students such as Number, nim, name, and value. After user input information about the students already, the program will show ten record of the students.

Source code:


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

int main(void)
{
    int k;
    struct data
    {
        int number;
        char nim[20];
        char name[20];
        char value;
    };
    struct data st[10];
    printf("Input students' information\n");
    for (k=0;k<10;k++)
    {
        printf("Input Data %d \n",k+1);
        printf("Number : ");
        fflush(stdin);
        scanf("%d", &st[k].number);
        fflush(stdin);
        printf("NIM : ");
        scanf("%s", &st[k].nim);
        fflush(stdin);
        printf("Name : ");
        scanf("%s", &st[k].name);
        fflush(stdin);
        printf("Value : ");
        scanf("%c", &st[k].value);
    }

    for (k=0;k<10;k++)
    {
        printf("\nYour Data %d \n",k);
        printf("Number : %d", st[k].number);
        printf("\nNIM : %s", st[k].nim);
        printf("\nName : %s", st[k].name);
        printf("\nValue : %c", st[k].value);
    }
    system("pause");
    return 0;
}


This is about the video or you can also see it at youtube.com by click this link below:
http://www.youtube.com/watch?v=EurlFTnlQ0A&feature=youtu.be

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




Program for calculate tomorrow date

Name: Chroeng Soklay
Major: D4 TMD ITB Batch6

This is my video show about how to write a program to find tomorrow date.

                            

Link to youtube: http://youtu.be/ZXoz8Z6qQNM

How to Create Work Dates arithmetic program Tomorrow

Name : Om Chanlyta
Major : TMD

Hello processor these code and video below are show you about how to create work date arithmetic program tomorrow :

#include <stdio.h>
#include <stdlib.h>
int main(){
    struct days
    {
        int day;
        int month;
        int year;
    };
    struct days now,tomorrow;
    int tdate[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    printf("Input value of day ");
    scanf_s("%d",&now.day);
    printf("\nInput value of month ");
    scanf_s("%d",&now.month);
    printf("\nInput value of year ");
    scanf_s("%d",&now.year);
    if(now.day<tdate[now.month-1])
    {
        tomorrow.day=now.day+1;
        tomorrow.month=now.month;
        tomorrow.year=now.year+1;
    }
    else if (now.month ==12)
    {
        tomorrow.day=1;
        tomorrow.month=1;
        tomorrow.year =now.year + 1;

    }
    else
    {
        tomorrow.day =1;
        tomorrow.month = now.month + 1;
        tomorrow.year = now.year;
    }
    printf("\n tomorrow is day %d month %d year %d \n", tomorrow.day,tomorrow.month,tomorrow.year);
    system("pause");
}





This is my link :
http://www.youtube.com/watch?v=A-dOJmmsT9E&feature=youtu.be

Convertion from today to tomorrow

Name: Chea Lida
Major: TMD



http://youtu.be/Bv2UDvDuRBM

Code for calculate date tomorrow

Dear Lecturer

Name: Deab Sina
Major: D4 TMD ITB Batch6

Video:

Coding:

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

int main(void)
{
    struct date // We declare struct variable that have content date, month, year
    {
        int date;
        int month;
        int year;
    };
    struct date now, tomorrow;
   
    int tdate[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; // element of array
    printf("Insert Today Date In This Format : dd mm yyyy\n");
    scanf_s("%d %d %d", &now.date, &now.month, &now.year);
   
    if(now.date < tdate[now.month-1])
    {
        tomorrow.date = now.date +1;
        tomorrow.month = now.month;
        tomorrow.year = now.year;
    }
    else if(now.month == 12)
    {
        tomorrow.date = 1;
        tomorrow.month = 1;
        tomorrow.year = now.year + 1;
    }
    else
    {
        tomorrow.date = 1; 
        tomorrow.month = now.month + 1;
        tomorrow.year = now.year;
    }

    printf("Tomorrow is date %d month %d year %d\n", tomorrow.date, tomorrow.month, tomorrow.year);
    system("pause");
}

Link:


Thanks,