Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

Nama : M.

Singgi Aditya Ramadhan


NIM : 220605110068

1. Boolean
a. Pseudecode
Algoritma Boolean
{Program untuk menghasilkan tipe data boolean}

Deklarasi :
b0: Boolean;
b1 : Boolean;
b2 : Boolean;
b3 : Boolean;

Deskripsi:
read(b0, b1, b2, b3)

print("bo = ", b0)


print("b1 = ", b1)
print("b2 = ", b2)
print("b3 = ", b3)

print("b0 AND b1 =", (b0 and b1))

print("b0 OR b1 =", (b1 or b2))

print("b0 AND b1 =", not b3)

end
b. Flowchart
c. Source code & ouput

 Source code
1. Java

2. Phyton
3. C#
 Output
2. Bilangan Bulat
a. Pseudecode
Algoritma Bilangan Bulat
{Program untuk menghasilkan tipe data bilangan bulat}

Deklarasi :
n1:integer;
n2:integer;
h1:integer;
h2:integer;
h3:integer;
h4:integer;
h5:integer;
h6:integer;
h7:integer;

Deskripsi:
read(n1,n2,h1, h2, h3, h4,h5, h6, h7)

print(n1, “+”, n2, “=”, h1 )


print(n2, “-”, n1, “=”, h2 )
print(n1, “*”, n2, “=”, h3 )
print(n2, “//”, n1, “=”, h4 )
print(n2, “%”, n1, “=”, h5 )
print(n1, “<<”, 2, “=”, h6 )
print(n2, “>>”, 2, “=”, h7 )

print(n1,'+=1 =', end="")


n1+=1
print(n1)

print(n2,'-=1 =', end="")


n2-=1
print(n2)

end
b. Flowchart

c. Source code & ouput


 Source code
1. Java

2. Phyton
3. C#

 Output
3. Bilangan Rill
a. Pseudecode
Algoritma Bilangan Rill
{Program untuk menghasilkan tipe data Bilangan real}

Deklarasi :
n11:Double;
n22 :Double;
h11 :Double;
h22 :Double;
h33 :Double;
h44 :Double;
h55 :Double;

Deskripsi:
read(n11, n22, h11, h22, h33, h44, h55)

print(n11, "+" , n22 , "=" , h11)


print(n22, "-" , n11 , "=" , h22)
print(n11, "*" , n22 , "=" , h33)
print(n22, "/" , n11 , "=" , h44)
print(n22, "%" , n11 , "=" , h55)

end
b. Flowchart

c. Source code & ouput

 Source code
1. Java
2. Phyton

3. C#
 Output
4. Karakter
a. Pseudecode
Algoritma Karakter
{Program untuk menghasilkan tipe data karakter}

Deklarasi :
c1: Character;
c2 : Character;

Deskripsi:
read(c1,c2)

print(c1, "<", c2, "?", (c1 < c2))


print(c1, "<=", c2, "?", (c1 <= c2))
print(c1, ">", c2, "?", (c1 > c2))
print(c1, ">=", c2, "?", (c1 >= c2))
print(c1, "==", c2, "?", (c1 == c2))
print(c1, "!=", c2, "?", (c1 != c2))

end

b. Flowchart
c. Source code & ouput

 Source code
1. Java
2. Phyton

3. C#

 Output
5. String
a. Pseudecode
Algoritma String
{Program untuk menghasilkan tipe data string}

Deklarasi :
s1: String;
s2: String;
s3: String;

Deskripsi:
read(s1,s2,s3)

print("h +", s2, "=", s3)


print(s1, "==", s3, "?", s1 == s3 )
print(s1, "!=", s2, "?", not s1 == s2)

end

b. Flowchart
c. Source code & ouput

 Source code
1. Java

2. Phyton
3. C#

 Output

You might also like