Skip to content

Instantly share code, notes, and snippets.

@utkumalkocoglu
utkumalkocoglu / hesaplayici.rb
Created October 8, 2013 11:25
Vize final notu ortalaması
puts "Ortalama Hesaplama"
print "Vize Notu Girin="
x=gets
print "Final notu Girin="
y=gets
k=x.to_i*0.4 + y.to_i*0.6
puts "Donem Sonu ortalamaniz #{k}"
@utkumalkocoglu
utkumalkocoglu / vizeFinalNotHesabı.rb
Last active June 24, 2016 10:36
Vize final not ortalaması , geçtiniz kaldınız
puts"Ortalama Hesaplayici"
print"Vize Notunu Giriniz="
x=gets.chomp
print"Final Notunu Giriniz="
y=gets.chomp
k=x.to_i*0.4 + y.to_i*0.6
puts"Donem Sonu Ortalamaniz= #{k}"
if k>=60
puts"Bu dersten gectiniz."
else
@utkumalkocoglu
utkumalkocoglu / HarfliBasariNotu.rb
Last active June 24, 2016 10:37
Harfli Başarı Notu Hesaplama
puts"Ortalama Hesaplayici"
print"Vize Notunu Giriniz="
x=gets.chomp
print"Final Notunu Giriniz="
y=gets.chomp
k=x.to_i*0.4 + y.to_i*0.6
puts"Donem Sonu Ortalamaniz= #{k}"
if k>90
puts"Bu dersten A aldiniz"
else if (90>k and k>75)
@utkumalkocoglu
utkumalkocoglu / BodyIndex.rb
Last active June 24, 2016 10:37
Boy Kilo Endexi Hesaplama
puts" Boy Kilo Endeksi Hesaplama"
print "Kilonuzu Giriniz="
x=gets.to_f
print"Boyunuzu metre cinsinden giriniz="
y=gets.to_f
z=y**2
k=x.to_f / z.to_f
puts"Boy kilo Endeksiniz = #{k} "
if (k>0 and k<=18.4)
puts"Zayifsiniz"
@utkumalkocoglu
utkumalkocoglu / NotHarflendirme.rb
Last active June 24, 2016 10:38
Not Harflendirme Örneği
puts"Ortalama Hesaplayici"
print"Vize Notunu Giriniz="
x=gets.chomp
print"Final Notunu Giriniz="
y=gets.chomp
k=x.to_i*0.4 + y.to_i*0.6
puts"Donem Sonu Ortalamaniz= #{k}"
if k>=90
puts"Bu dersten A aldiniz"
else if (90>k and k>=75)
puts"Ondalik sayi olusturma"
print"Sa yinizin tam kismini giriniz="
x=gets.to_i
print"Sayinizin ondalik kismini giriniz="
y=gets.to_i
puts "Sayiniz asagida yazmaktadir"
k=x.to_i,y.to_i
print k
puts"Islem tamamlanmistir."
array = [ "fat", "bat", "rot"] dizisindeki elemanlara "man" ekleyecek kod aşağıdaki seçeneklerden hangisidir?
Select one:
a. counter = 0
array = [ "fat", "bat", "rat"]
while counter < array.length
puts array[counter] + "man"
counter += 1
end Correct
#encoding: utf-8
p "kelimeyi yazınız"
i=gets.chomp.to_s
puts
"Kelimeniz #{i}, : "
a = ["a","b","c","ç"]
a.each do |x=dizi.pop|
if i[x]
p "#{x} numara karşılığı 2"
end
class Kare
def initialize(kenar)
@kenar=kenar
end
def alan
@kenar*@kenar
end
def cevre
4*@kenar
end
class Celcius
def initialize(celcius)
@celcius = celcius
end
def fahrenayt
(@celcius*9/5)+32
end
end