Arama Motoru

rtyucel.wordpress.com: Mesleki Eğitim BT blogu

Cuma, Mayıs 02, 2008

Basit Programlama Örnekleri -2

10.Sınıf BTT dersi Programlama Temelleri modülü kapsamında uygulanabilecek ve Quick Basic ile programlama yeni başlayanlara yönelik 1 basit uygulama daha.
Soru:Bir Öğrenciye ait okul no, adı, soyadı, bir dersten 1.-2. ve 3. sınav notlarına göre ortalamasını klavyeden girilerek ortalamasını ve durumunu ekrana yazdıran program kodunu yazınız.
Cevap:

CLS

DIM ogrNo AS INTEGER
DIM not1 AS INTEGER
DIM not2 AS INTEGER
DIM not3 AS INTEGER
DIM ogrAdi AS STRING
DIM ogrSoyadi AS STRING
DIM durum AS STRING
DIM ortalama AS SINGLE

PRINT ""
PRINT "--------------------"
PRINT ""

INPUT "Öğrenci Numarası : ", ogrNo
INPUT "Öğrenci Adı : ", ogrAdi
INPUT "Öğrenci Soyadı : ", ogrSoyadi

PRINT ""
PRINT "--------------------"
PRINT ""

INPUT "1.Sınav Notu : ", not1
INPUT "2.Sınav Notu : ", not2
INPUT "3.Sınav Notu : ", not3

CLS

ortalama = (not1 + not2 + not3) / 3

IF ortalama >= 45 THEN
durum = "Geçti"
ELSE
durum = "Kaldı"
END IF

PRINT ""
PRINT "--------------------"
PRINT ""

PRINT "Öğrenci No:"; ogrNo
PRINT "Öğrenci Adı:"; ogrAdi
PRINT "Öğrenci Soyadı:"; ogrSoyadi

PRINT ""
PRINT "--------------------"
PRINT ""

PRINT "1.Sınav Notu:"; not1
PRINT "2.Sınav Notu:"; not2
PRINT "3.Sınav Notu:"; not3

PRINT ""
PRINT "--------------------"
PRINT ""

PRINT "Ortalama:"; ortalama

PRINT ""
PRINT "--------------------"
PRINT ""

PRINT "Durum:", durum

0 yorum:

website counter

Add to Google Reader or Homepage