Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include Library | |
#include <iostream> | |
#include <iomanip> | |
#include <stdlib.h> | |
#include <time.h> | |
using namespace std; | |
// Program Arisan | |
//Untuk Antrian, dengan asumsi batas peserta antrian adalah 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mencetak Menu | |
def menu(): | |
print("1. Persegi Panjang") | |
print("2. Lingkaran") | |
print("3. Segitiga") | |
print("4. Keluar") | |
def persegi(): | |
print("Menghitung Luas Persegi Panjang") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Menginput Suhu dalam Derajat Celcius | |
celcius = float(input("Tuliskan Suhu dalam Celcius: ")) | |
# Menghitung Suhu dalam Derajat Fahrenheit | |
fahrenheit = (celcius * 1.8) + 32 | |
# Menampilkan Hasil Konversi Jarak | |
print('%0.2f Derajat Celcius sama dengan %0.2f Derajat Fahrenheit' % (celcius, fahrenheit)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tugas = float(input("Masukkan nilai Tugas: ")) | |
uts = float(input("Masukkan nilai UTS: ")) | |
uas = float(input("Masukkan nilai UAS: ")) | |
nilai = (0.15 * tugas) + (0.35 * uts) + (0.50 * uas) | |
if nilai > 80: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mengimpor Modul Calendar | |
import calendar | |
# Menginput Tahun dan Bulan | |
yy = int(input("Masukkan Tahun: ")) | |
mm = int(input("Masukkan Bulan: ")) | |
# Menampilkan Kalender Bulanan | |
print(calendar.month(yy, mm)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Menginput Angka | |
angka = int(input("Tulis sebuah Angka: ")) | |
# Jika Habis Dibagi Nol, Maka Genap | |
if (angka % 2) == 0: | |
print("{0} adalah Bilangan Genap".format(angka)) | |
# Jika Tidak Habis Dibagi Nol, Maka Ganjil | |
else: | |
print("{0} adalah Bilangan Ganjil".format(angka)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Kalkulator Sederhana Python") | |
print("1. Penjumlahan") | |
print("2. Pengurangan") | |
print("3. Perkalian") | |
print("4. Pembagian") | |
pil = int(input("\nMasukan Pilihan Operasi : ")) | |
x= int(input("Bilangan 1 : ")) | |
y= int(input("Bilangan 2 : ")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tinggi = int(input("Masukan tinggi badan dalam CM: ")) | |
bbnorm = tinggi-100 | |
bbideal = bbnorm-10/100 | |
print("\nBerat Normal: %d Kg" %bbnorm) | |
print("\nBerat Ideal: %d Kg" %bbideal) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Menampilkan Angka Acak antara 0 sampai 20 | |
# Mengimpor Modul Random | |
import random | |
# Menampilkan Angka Acak | |
print(random.randint(0, 20)) |
NewerOlder