Skip to content

Instantly share code, notes, and snippets.

View oskaryil's full-sized avatar
🛠️
Building things

Oskar Yildiz oskaryil

🛠️
Building things
View GitHub Profile
@oskaryil
oskaryil / main.cpp
Created August 19, 2016 17:09
Odd and even number sorter.
#include <iostream>
#include <vector>
using namespace std;
// User inputs 10 integers which get sorted between odd and even numbers.
int main() {
cout << "Enter 10 numbers please:" << endl;
@oskaryil
oskaryil / main.cpp
Created August 22, 2016 15:54
po.kattis.com cookies practice problem
#include <iostream>
#include <vector>
using namespace std;
int cookies(int N, vector<int> A) {
int totalCookies;
for(int i = 0; i < A.size(); i++) {
totalCookies += A[i]; // Add the amount of each type of cookie to the total.
}
@oskaryil
oskaryil / main.cpp
Last active August 28, 2016 07:31
Circle Area Calculator Assignment
#include <iostream>
#include <cmath>
using namespace std;
/*
Title: CIRCLE AREA CALCULATOR
Description: Calculates the area of a circle upon user input of the circle's radius.
AUTHOR: OSKAR YILDIZ
*/
@oskaryil
oskaryil / main.cpp
Created August 28, 2016 07:59
Calculate VAT upon entering the price of a product before VAT(25%) has been applied.
#include <iostream>
using namespace std;
/*
* TITLE: VAT PRICE CALCULATOR
* DESCRIPTION: A calculator that applies VAT(25%) to the price of a product.
* AUTHOR: OSKAR YILDIZ
*/
@oskaryil
oskaryil / main.cpp
Created September 25, 2016 19:20
Bilförsäkring - Programmerings uppgift 1 inlämning
#include <iostream>
#include <iomanip>
#include <ctime>
using namespace std;
int main() {
time_t t = time(0); // initialisera tids objektet
@oskaryil
oskaryil / skottar.cpp
Created September 30, 2016 08:00
Skottår
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> skottar;
vector<int> input;
@oskaryil
oskaryil / provResultat.cpp
Created September 30, 2016 08:04
caclulate best(highest) number in an array
#include <iostream>
using namespace std;
int main() {
double provResultat[] = {3.5, 27.2, 18.2, 28.2, 11.0, 15.5, 18.5, 17.5, 19.0};
double best = provResultat[0];
int storlek = sizeof(provResultat)/sizeof(double);
for(int i = 1; i<storlek;i++) {
@oskaryil
oskaryil / main.js
Created October 17, 2016 13:42
toilet app
import Exponent from 'exponent';
import React from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
import MapView from 'react-native-maps';
import NavigationBar from 'react-native-navbar';
@oskaryil
oskaryil / main.js
Last active October 18, 2016 12:46
import Exponent from 'exponent';
import React from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
import MapView from 'react-native-maps';
import NavigationBar from 'react-native-navbar';
<?php
$posts = get_posts([
'post_status' => 'publish',
'posts_per_page' => -1,
'post_type' => 'abc'
]);
$post_index = array_fill_keys( array_merge( [ '#' ], range( 'a', 'z' ), ['å', 'ä', 'ö', ] ), [] );
foreach( $posts as $post ) {
$first_letter = strtolower( substr( $post->post_title, 0, 1 ) );
if( is_numeric( $first_letter ) ) {