0% found this document useful (0 votes)
50 views9 pages

Praktikum Perograman 2

This document contains a report on a programming practice by Bahagia Rasida. It includes: 1. The coding for a program that prints a student's grade report card based on test scores input by the user. 2. Screenshots of the program being created and run, with input and output examples. 3. The coding for two additional programs - one that calculates the remainder of a division problem, and another that calculates the factorial of a number. 4. The author's biodata.

Uploaded by

BeGeRasida
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views9 pages

Praktikum Perograman 2

This document contains a report on a programming practice by Bahagia Rasida. It includes: 1. The coding for a program that prints a student's grade report card based on test scores input by the user. 2. Screenshots of the program being created and run, with input and output examples. 3. The coding for two additional programs - one that calculates the remainder of a division problem, and another that calculates the factorial of a number. 4. The author's biodata.

Uploaded by

BeGeRasida
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

LAPORAN

PRAKTIKUM PEMROGRAMAN 2

Bahagia rasida
09.0504.0077
Dosen pengampu
R.Arri Widyanto,S.Kom,MT

FAKULTAS TEKNIK
PROGRAM STUDI INFORMATIKA S1

UNIVERSITAS MUHAMMADIYAH MAGELANG


2010

CODING PROGRAM :
#include"stdio.h"
#include"conio.h"
#include"iostream.h"
void main()
{
int byk,mah,b[1000],tot;
float rat;
char nam[15],strnpm[15],m;
do
{clrscr();
printf(" Input nama : ");scanf("%s",&nam);
printf(" Input npm : ");scanf("%s",&strnpm);printf("\n");
printf(" Jumlah MK yang akan dihitung : ");scanf("%d",&byk);
for(mah=1;mah<=byk;mah++)
{printf("Input nilai MK %s ",nam);printf("ke- %d : ",mah);scanf("%d",&b[mah]);}
clrscr();
{
printf("\n");
printf("KARTU NILAI HASIL UJIAN UNTUK MAHASISWA DENGAN NAMA
%s\n",nam);
printf("\n");
printf("
|=====|================|==============|========|=============|\n");
printf(" | No | Nama
| NPM
| Nilai | Keterangan |\n");
printf("
|=====|================|==============|========|=============|\n");
for(mah=1;mah<=byk;mah++)
{printf(" |%3d |",mah);printf("%11s |",nam);printf("%13s |",strnpm);printf(" %5d
|",b[mah]);if(b[mah]>50)printf(" LULUS
|\n");else printf(" TIDAK LULUS |\n");}
printf(" |_____|________________|______________|________|_____________|\n");
tot=0;
for(mah=1;mah<=byk;mah++)
tot=tot+b[mah];
printf("
JUMLAH NILAI %d\n",tot);
printf(" Nilai Rata-rata %.2f\n",rat=tot/byk);printf("\n");
printf(" dari hasil rata-rata nilai yang telah diperoleh, maka mahasiswa ybs
dinyatakan\n");
if(rat>50)printf("
- * L U L U S * -\n");else printf("
-*TIDAK LULUS*\n");printf("\n");
cout<<"Cetak Lagi ? (y/t) : ";cin>>m;}}
while(m=='y');
}

PRINTSCREEN PEMBUATAN PROGRAM :

OUTPUT :
-

INPUT DATA

OUTPUT DATA

1. KODE PROGRAM SISA HASIL BAGI


#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream.h>
void main()
{int a,b;
div_t hasil;
char c;
do
{
clrscr();
printf(" ********************************************************\n");
printf("
MENGHITUNG SISA HASIL BAGI \n");
printf(" ********************************************************\n");
printf("\n");
printf(" Input Bilangan Yang akan dibagi : "); scanf("%d",&a);
printf(" Input Bilangan Pembagi
: "); scanf("%d",&b);
printf("\n");
hasil = div(a,b);
printf(" |==================|==================================|\n");
printf(" | %2d : %2d = %2d | sisa hasil baginya adalah %2d |\n",a,b,hasil.quot,hasil.rem);
printf(" |==================|==================================|\n");
printf("\n");
cout<<"
Hitung Lagi ? (y/t) : ";cin>>c;}
while(c=='y');
}

PRINTSCREEN PEMBUATAN PROGRAM :

OUTPUT
- INPUT DATA

OUTPUT DATA

2. KODE PROGRAM BILANGAN FAKTORIAL


#include <stdio.h>
#include <conio.h>
long int faktorial(int a);
void main()
{ int a;
long int fkt;
printf("\n");
printf(" *********************************************\n");
printf("
MENCARI BILANGAN FAKTORIAL
\n");
printf(" *********************************************\n");
printf("\n");
printf("
Input Bilangan : "); scanf("%i",&a);
printf("\n");
fkt = faktorial(a);
printf("
|=============================|================|\n");
printf("
| FAKTORIAL %3i adalah : %4ld
|\n",a,fkt);
printf("
|=============================|================|\n");
}
long int faktorial(int a)
{int b;
long int fa=1;
if(a<=0)
return(0);
for(b=2;b<=a;b++)
fa=fa*b;
return(fa);
}
PRINTSCREEN PEMBUATAN PROGRAM :

OUTPUT PROGRAM ;
- INPUT DATA

OUTPUT DATA

Biodata Penulis

Nama Lengkap

: Bahagia Rasida

Tempat/Tgl Lahir

: Subulussalam NAD 08 Maret 1990

Alamat

: Magelang Jawa Tengah

Email

: [email protected]

Email FB

: [email protected]

Phone

: 082 133 888 504 / 087 834 111 101

PT

: Univ. Muhammadiyah Magelang


Fakultas Teknik prodi Informatika
Tahun Akademik 2009/2010

You might also like