Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# tugas2

839

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
839
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
16
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. TUGAS 2 ALGORITMA & PEMROGRAMAN 2A NAMA : ERRISTHYA . D.A NPM : 10108716
• 2. 1. MENGUBAH DERAJAT CELCIUS KE DERAJAT REAMUR DAN FAHRENHAIT
• USES CRT;
• VAR C,R,F : REAL;
• BEGIN
• CLRSCR;
• WINDOW(5,6,25,78);
• TEXTBACKGRAOUND(MAGENTA);
• TEXTCOLOR(WHITE);
• SOND(220);
• WRITE (‘ MASUKKAN NILAI C = ‘);
• R := C *(5/9);
• WRITELN(‘ REAMUR = ‘,R);
• F := C + 273;
• WRITELN(‘FAHRENHAIT = ‘,F);
• NOSOUND;
• END.
• 3. OUTPUT
• 4. 2.MENGHITUNG LUAS DAN KELILING LINGKARAN
• USES CRT;
• VAR R,L,K : REAL;
• BEGIN
• CLRSCR;
• WINDOW(10,13,27,80);
• TEXTBACKGROUND(WHITE);
• TEXTCOLOR(GREEN);
• SOUND(115);
• WRITE(‘MASUKKAN JARI-JARI = ‘ );
• K := 2 * (22/7)*R;
• WRITE (‘ KELILING = ‘, K);
• L := (22/7)* R * R;
• WRITE (‘LUAS = ‘,L);
• NOSOUND;
• END.
• 5. OUTPUT
• 6. 3. MENGHITUNG LUAS DAN KELILING SEGITIGA
• USES CRT;
• VAR A,B,C,K,L : REAL;
• BEGIN
• CLRSCR;
• WINDOW(5,5,35,70);
• TEXTBACKGROUND(YELLOW);
• TEXTCOLOR(BLUE);
• A := 3;
• B := 4;
• C := 5;
• K := A + B + C;
• GOTOXY (13,13);
• WRITELN(‘KELILING = ‘,K);
• L := (A+B)/2
• GOTOXY (20,16);
• WRITELN(‘LUAS = ‘,L);
• END.
• 7. OUTPUT
• 8. 4. MENENTUKAN NILAI SIN,COS,DAN TANGEN
• USES CRT
• VAR X : REAL;
• BEGIN
• CLRSCR;
• WINDOW(5,5,35,68);
• TEXTBACKGROUND(WHITE);
• TEXTCOLOR(CYAN);
• SOUND(70);
• WRITE(‘BESAR SUDUT = ‘);
• WRITELN(‘SIN = ‘,SIN(X));
• WRITELN(‘COS= ‘,COS(X));
• WRITELN(‘TAN = ‘,ARCTAN(X));
• NOSOUND;
• END.
• 9. OUTPUT
• 10. 5. MENCARI AKAR DAN KUADRAT NILAI
• USES CRT
• VAR X : REAL;
• BEGIN
• CLRSCR;
• WINDOW(5,5,35,68);
• TEXTBACKGROUND(WHITE);
• TEXTCOLOR(BLACK);
• SOUND(70);
• WRITE(‘MASUKKAN NILAI = ‘);
• GOTOXY(11,20);
• WRITELN(‘AKAR = ‘,SQRT(X):9:3);
• GOTO XY(13,44);
• WRITELN(‘PANGKAT = ‘,SQR(X):9:3);
• NOSOUND;
• END.
• 11. OUTPUT
• 12. 6. MENCARI NILAI BULAT DAN PECAHAN
• USES CRT;
• VAR X : REAL;
• BEGIN
• CLRSCR;
• WINDOW(5,7,32,70);
• TEXTBACKGROUND(WHITE);
• TEXTCOLOR(red);
• SOUND(85);
• WRITE(‘MASUKKAN NILAI = ‘);
• GOTOXY(11,14);
• WRITELN(‘PECAHAN= ‘,FRAC(X):5:3);
• GOTOXY(15,20);
• WRITELN(‘BILANGAN BULAT = ‘,INT(X):5:3);
• NOSOUND;
• END.
• 13. OUTPUT
• 14. 7. MENAMPILKAN NAMA DAN NPM DI TENGAH LAYAR
• USES CRT;
• BEGIN
• CLRSCR;
• WINDOW(5,7,32,70);
• TEXTBACKGROUND(WHITE);
• TEXTCOLOR(red);
• SOUND(85);
• GOTOXY(30,10);
• WRITELN (‘NAMA : ERRISTHYA ‘);
• GOTOXY(30,11);
• WRITELN (‘NPM : 10108716’);
• NOSOUND;
• END.
• 15. OUTPUT
• 16. 8. MENULIS STMIK GUNADARMA DI POJOK KANAN ATAS LAYAR & UKURAN WINDOW SAMA!!
• USES CRT;
• BEGIN
• CLRSCR;
• WINDOW(1,2,65,70);
• TEXTBACKGROUND(GREEN);
• TEXTCOLOR(red);
• SOUND(85);
• GOTOXY(65,1);