Şimdi Ara

c# ödewi için acil yardım

Bu Konudaki Kullanıcılar:
1 Misafir - 1 Masaüstü
5 sn
8
Cevap
0
Favori
414
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • arkadaşlar bu dönem okulda c dersi alıyorum

    fakat ödewin içinden çıkamadım

    hoca hem array hem function hemde rand komutunu kullanın dedi

    yardımcı olursanız sewinirim ödew şu;

    Computers are playing an increasing role in education. Write a program that will help an elementary school student learn multiplication. Use rand to produce two positive one-digit integers. It should then type a question such as:




    How much is 6 times 7 ?




    The student then types the answer. Your program checks the student’s answer. If it is correct, print “Very good!” and then ask another multiplication question. If the answer is wrong, print “No. Please try again.” And then let the student try the same question again repeatedly until the student finally gets it right.







    NOTES:

    Please make sure that each time your program is run, your algorithm should generate different random numbers.

    Use sentinel value to exit from reading integer numbers.

    Use a function to do multiplication.







  • bunu yazmak kolay, dil c# ise yazamam, syntax ini bilmiyorum..

    algoritmayi şöle düşünebilirsin.

    cikan_Sayilar[] arrayin olsun, ilk basta bos
    X = rand() ile üretilmiş 0-9 arasi sayi
    Y = rand() ile üretilmiş 0-9 arasi sayi
    A = X*10 + Y; yani x=5 y=6 ise A=56
    sayi cikmis mi kontrol et
    cikmadiysa ekle, cikmişsa önceden başka sayi üret

    devami daha kolay zaten.
  • valla c# nasıl yapıyosunuz çok zor bir iş gibi
  • Basic istesen yazıp verirdim ama,
    C+ öğrenmiş olmama rağman,kullanmadığım için unutuldu..
    Şu adres ihtiyacını karşılar belki
    http://www.sorucevap.com/bilisimteknolojisi/programcilik/c_plus/dersler.asp
    Kolay gele..
  • Başlıkta c# demissin ama mesajinda c yazıyordu ben de c ile yazdım bir tane, umarım işine yarar.... Çarpma işini function olarak yapmak lazımmış sonradan gördüm onuda kendin düzenleyebilirsin...

    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>

    int main ()
    {
    int sayi_1, sayi_2, sonuc;
    srand ( time(NULL) );
    sayi_1 = rand()%10;
    sayi_2 = rand()%10;

    while(1){
    printf("How much is %d times %d ? ",sayi_1,sayi_2);
    scanf("%d",&sonuc);
    if( sonuc == (sayi_1 * sayi_2) ){
    printf("Very good!\n");
    sayi_1 = rand()%10;
    sayi_2 = rand()%10;
    }else
    printf("No. Please try again\n");
    }//End_while

    return 0;
    }



    < Bu mesaj bu kişi tarafından değiştirildi master_monster -- 16 Kasım 2004, 23:46:46 >
  • çok saolun ben mantığını anlamıştım ama bir türlü ne yi nereye yazcağıma karar werememiştim
  • burda hocanin asil sordugu cavus un mesajinda yok.
    hocanın asıl istediği, rand ile yaratilan degerleri bir dizi de saklanmasi, ve ögrenci soruyu bildikten sonra ona yeni soru sorulmasi.. eski sorulan saklanan sorulardan kontrol etmen lazim.

    bunu untma
  • ayrica cavusta while loop'undan cikis ta yok. cocuk carpip carpip duracak sonsuza kadar. sentinel value koyunca ciksin demis, yani diyelim sentinel deger -1 olsun. scanf in sonucunda -1 oldugunda cikmasi lazim.
    yukarda int sentinel = -1; seklinde tanimlanip,
    while (sonuc!=sentinel)
    {
    blabla
    }

    olmasi gerekir.
  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.