Skip to content

Instantly share code, notes, and snippets.

View ddikodroid's full-sized avatar
🚀
rocket science

Ahmad Syarifuddin Randiko ddikodroid

🚀
rocket science
  • Central Bank of Indonesia
  • Jakarta, Indonesia
  • 21:00 (UTC +07:00)
  • X @pxlpd
View GitHub Profile
@ddikodroid
ddikodroid / fibonacci.cpp
Created September 22, 2016 14:07
a simple program to print a series of fibonacci
/*
Fibonacci
Computer Science UGM
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
@ddikodroid
ddikodroid / tabel perkalian.cpp
Last active September 22, 2016 14:47
a simple program to print multiplication table, amount of column and row based on user input.
/*
Tabel Perkalian
dengan Nested Looping
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
@ddikodroid
ddikodroid / sitemap code v2
Last active September 22, 2016 15:55
sitemap used in diko personal blog
<style type="text/css">
#toc{
width:99%;
margin:5px auto;
border:1px solid #E5E5E5;
-webkit-box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);
-moz-box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);
box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);
}
.labl{
@ddikodroid
ddikodroid / integer to digits and sum.cpp
Last active September 23, 2016 14:45
Integer to digits and sum created by Faqih. Still have some bugs.
/* NumDigit Segregation-Summation */
~Instruction:
Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.
~e.g: 1234 --> 1 2 3 4 & Sum = 10
-2131 --> 2 1 3 1 & Sum = 7
A. Logic
1) Num modulo 10
2) Save the result of modulo operation
@ddikodroid
ddikodroid / besar_angsuran.cpp
Created October 18, 2016 07:15
besar angsuran pake case-switch, function, looping. belum ada array. masih error :v
#include<bits/stdc++.h>
using namespace std;
/* menentukan besaran angsuran */
int bsr_angsuran;
void bsr_angsuran(int harga,int jangka_waktu,float bunga){
for(int a=1;a<=jangka_waktu;a++){
harga*=bunga;
@ddikodroid
ddikodroid / besar_angsuran v2.cpp
Last active October 19, 2016 11:17
error :( apa yg salah :(
#include<bits/stdc++.h>
using namespace std;
void hitung_angsuran(int harga, int lama_angsuran){
int i;
float bunga[6] : {0.75, 1, 1.25, 1.5, 1.75, 2};
if(lama_angsuran>0 && lama_angsuran<=12){
bunga[i]=bunga[5]
}
else if(lama_angsuran>12 && lama_angsuran<=24){
@ddikodroid
ddikodroid / angsuran_v3.cpp
Last active October 20, 2016 05:27
final :v
#include<bits/stdc++.h>
using namespace std;
float hitung_angsuran(int harga, int lama_angsuran){
int i=0;
long int bsr_angsuran;
float bunga[6] = {0.75, 1, 1.25, 1.5, 1.75, 2};
if(lama_angsuran>0 && lama_angsuran<=12){
bunga[i]=bunga[5];
}
/* Dibuat oleh Ahmad Syarifuddin Randiko dan Marisha Salsabila */
/* lama_angsuran maksimal 72 dan harga maksimal 10 x 10^9 */
#include<iostream>
#include<iomanip>
#include<cstdlib>
using namespace std;
float hitung_angsuran(int harga, int lama_angsuran);
int funct(int x){
return (x<=1)?1 : funct(x-1)+funct(x-2);
}
int main(){
cout << funct(5) << endl;
return 0;
}
@ddikodroid
ddikodroid / prakbasdat.txt
Created September 27, 2017 06:03
praktikum basis data 27 september
cd xampp/mysql/bin
mysql.exe -u root
create database [NAMA DB];
show databases;
use [NAMA DB];
create table dosen(id_dosen int primary key auto_increment, nama_dosen varchar(50) not null,);
describe dosen;
insert into dosen (nama_dosen) values ('diko');
insert into dosen (nama_dosen) values ('nabil');
insert into dosen (nama_dosen) values ('hatta');