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
/* | |
Fibonacci | |
Computer Science UGM | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ |
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
/* | |
Tabel Perkalian | |
dengan Nested Looping | |
*/ | |
#include<bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int n; |
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
<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{ |
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
/* 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 |
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<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; |
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<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){ |
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<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]; | |
} |
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
/* 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); |
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
int funct(int x){ | |
return (x<=1)?1 : funct(x-1)+funct(x-2); | |
} | |
int main(){ | |
cout << funct(5) << endl; | |
return 0; | |
} |
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
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'); |
OlderNewer