Your SlideShare is downloading. ×

tugas2

839

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
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 = ‘);
        • READLN (C);
        • R := C *(5/9);
        • WRITELN(‘ REAMUR = ‘,R);
        • F := C + 273;
        • WRITELN(‘FAHRENHAIT = ‘,F);
      • NOSOUND;
      • READLN;
      • 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 = ‘ );
        • READLN(R);
        • K := 2 * (22/7)*R;
        • WRITE (‘ KELILING = ‘, K);
        • L := (22/7)* R * R;
        • WRITE (‘LUAS = ‘,L);
      • NOSOUND;
      • READLN;
      • 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);
      • READLN;
      • 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 = ‘);
        • READLN(X);
        • WRITELN(‘SIN = ‘,SIN(X));
        • WRITELN(‘COS= ‘,COS(X));
        • WRITELN(‘TAN = ‘,ARCTAN(X));
      • NOSOUND;
      • READLN;
      • 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 = ‘);
        • READLN(X);
        • GOTOXY(11,20);
        • WRITELN(‘AKAR = ‘,SQRT(X):9:3);
        • GOTO XY(13,44);
        • WRITELN(‘PANGKAT = ‘,SQR(X):9:3);
      • NOSOUND;
      • READLN;
      • 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 = ‘);
        • READLN(X);
        • GOTOXY(11,14);
        • WRITELN(‘PECAHAN= ‘,FRAC(X):5:3);
        • GOTOXY(15,20);
        • WRITELN(‘BILANGAN BULAT = ‘,INT(X):5:3);
      • NOSOUND;
      • READLN;
      • 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;
      • READLN;
      • 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);
        • WRITELN (‘STMIK GUNADARMA’);
      • NOSOUND;
      • READLN;
      • END
  • 17. OUTPUT

×