tugas pascal 2

Download tugas pascal 2

Post on 07-Dec-2014

2.129 views

Category:

Education

4 download

Embed Size (px)

DESCRIPTION

tugas

TRANSCRIPT

  • 1. ALGORITMA & PEMROGRAMAN 2A NAMA : TUNSRI INDRA HIDAYAT NPM : 11108980
  • 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( WHITE );
      • TEXTCOLOR(BLUE);
      • SOND(100);
        • 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(WHITE);
      • TEXTCOLOR(BLUE);
        • A := 2;
        • B := 4;
        • C := 3;
        • 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