Tugas Ii Algoritma Dan Pemrograman 2 A
Upcoming SlideShare
Loading in...5
×
 

Tugas Ii Algoritma Dan Pemrograman 2 A

on

  • 4,349 views

 

Statistics

Views

Total Views
4,349
Views on SlideShare
4,342
Embed Views
7

Actions

Likes
0
Downloads
101
Comments
0

1 Embed 7

http://www.slideshare.net 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Tugas Ii Algoritma Dan Pemrograman 2 A Tugas Ii Algoritma Dan Pemrograman 2 A Presentation Transcript

  • TUGAS II ALGORITMA DAN PEMROGRAMAN 2A 1. Mengubah derajat temperatur, dari derajat Celcius ke derajat Fahreinheit dan Reamur (derajat Celcius diinput)   PROGRAM celcius; USES CRT; VAR F,C,R : REAL; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(BLUE); TEXTCOLOR(BROWN); SOUND(220); GOTOXY(10,6); WRITE('Nilai Celcius : ');READLN(C); F := 1.8 * C + 32; R := 0.8 * C; GOTOXY(10,7); WRITELN (C:6:2,' Celcius sama dengan ',F:6:2,' Farenheit '); GOTOXY(10,8); WRITELN (C:6:2,' Celcius sama dengan ',R:6:2,' Reamur '); READLN; END.
  • OUTPUT :
  • 2. Menghitung Luas dan Keliling lingkaran, dengan jari-jari diketahui (diinput).   uses crt; var jari,luas,keliling : real; begin clrscr; window(7,7,25,80); textbackground(green); textcolor(yellow); sound(220); gotoxy(1,4); writeln('==menghitung luas dan keliling lingkaran=='); gotoxy(1,6); write('masukan jari-jari = '); readln(jari); luas:=3.14*jari*jari; keliling:=2*3.14*jari; gotoxy(1,7); writeln('luas : ',luas:6:2); gotoxy(1,8); writeln('keliling : ',keliling:6:2); readln; end.
  • OUTPUT :
  • 3. Menghitung Luas dan Keliling segitiga sembarang yang diketahui ke tiga sisinya .   PROGRAM SEGITIGA; USES CRT; VAR A,B,C,K,L,N,keliling: REAL; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(RED); TEXTCOLOR(WHITE); SOUND(220); GOTOXY(10,3); WRITE('SISI 1 : ');READLN(A); GOTOXY(10,4); WRITE('SISI 2 : ');READLN(B); GOTOXY(10,5); WRITE('SISI 3 : ');READLN(C); keliling := A+B+C; K := 1/2*keliling; N := K*(K-A)*(K-B)*(K-C); GOTOXY(10,6); WRITELN('Keliling Segitiga : ',keliling:6:2); GOTOXY(10,7); WRITELN('Luas Segitiga : ',SQRT(N):6:2); NOSOUND; READLN; END.
  • OUTPUT :
  • 4. Mencari nilai Sinus, Cosinus, dan Tangen dengan sudut diinput.   USES CRT; VAR sudut : REAL; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(BROWN); TEXTCOLOR(WHITE); SOUND(220); GOTOXY(35,5); WRITE('MASUKKAN NIALI SUDUT : ');READLN(sudut); GOTOXY(35,6); WRITELN('Sinus : ',SIN(sudut):6:2); GOTOXY(35,7); WRITELN('Cosinius : ',COS(sudut):6:2); GOTOXY(35,8); WRITELN('Tangen : ',ARCTAN(sudut):6:2); NOSOUND; READLN; END.
  • OUTPUT :
  • 5. Mencari akar dan kuadrat dari suatu nilai (nilai diinput).   USES CRT; VAR N : REAL; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(WHITE); TEXTCOLOR(BLUE); GOTOXY(10,3); SOUND(220); WRITE('Masukkan Nilai : ');READLN(N); GOTOXY(10,5); WRITELN('Nilai N dipangkatkan : ',SQR(N):9:2); GOTOXY(10,6); WRITELN('Nilai N diakarkan : ',SQRT(N):9:2); NOSOUND; READLN; END.
  • OUTPUT :
  • 6. Mencari nilai bulat dan pecahan dari suatu nilai yang dimasuk kan melalui keyboard (diinput). Nilai pecahan tersebut dibulatkan sampai 3 angka dibelakang koma (,).   USES CRT; VAR A : REAL; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(YELLOW); TEXTCOLOR(RED); SOUND(220); GOTOXY(15,5); WRITE('Masukkan Nilai : ');READLN(A); GOTOXY(12,7); WRITELN('Nilai Bulatnya: ',INT(A):6:3); GOTOXY(12,8); WRITELN('Nilai Pecahannya : ',FRAC(A):6:3); READLN; END.
  • OUTPUT :
  • 7. Tampilkan nama dan NPM anda di dalam window, dan terletak pada tengahtengah layar.   PROGRAM Layar; USES CRT; BEGIN CLRSCR; WINDOW(7,7,25,80); TEXTBACKGROUND(WHITE); TEXTCOLOR(GREEN); SOUND(220); GOTOXY(30,10); WRITELN('Nama : Bestiria Reska'); GOTOXY(33,11); WRITELN('Kelas : 1 KA 20'); NOSOUND; READLN; END.
  • OUTPUT :
  • 8. Tampilkan tulisan 'STMIK GUNADARMA' di dalam window pada pojok kanan atas dengan ukuran window sama dengan tulisan tersebut.!   PROGRAM Layar2; USES CRT; BEGIN CLRSCR; WINDOW(2,2,15,50); TEXTBACKGROUND(BLUE); TEXTCOLOR(YELLOW); SOUND(220); GOTOXY(65,1); WRITELN('STMIK GUNADARMA'); NOSOUND; READLN; END.
  • OUTPUT :