Can Someone Help Me? (Algorithm in C)

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
É na sola da bota é na palma da bota
Onaylı Üye
Katılım
4 May 2022
Mesajlar
74
Çözümler
1
Tepki puanı
14
Yaş
25
Sosyal
4 HİZMET YILI
Suppose you work at a software development company that develops software aimed at education, more specifically educational games.
You are asked to dedicate part of your working time to the development of a simple game in the form of an algorithm that can be used by literate people of any age.
Then comes the idea of developing a guessing game, where a random number between 0 and 10 is generated by the computer and stored for the player to try to guess it.
Please note the following requirements that must be contained in the game algorithm:

1. The game must generate an integer numeric value between 0 and 10 and store it for use during execution.
2. The user must be able to enter as many guesses as he wants until he hits the secret number generated by the computer.
3. If the number entered by the user in each guess is smaller than the secret number, a message must inform that the guess was low, and otherwise, if it is greater than the secret number, it must be informed that the guess was high.
4. Only in the case of a correct guess regarding the secret number, the player must be informed of the correct answer and the game must then be ended.

Note: Additions of features such as language adjustment are optional and do not add a grade, but others such as inserting a guess limit or other ideas that change the original requirements can generate a discount on the grade because they change what must be delivered in the activity.
------------
Ok, it's a college exam and I need to make this algorithm but I really sucks at programming and I really don't know how to do it. Can anyone make it for me? I'll be very grateful.
 
Üye
Katılım
17 Tem 2022
Mesajlar
9
Tepki puanı
1
Ödüller
1
Yaş
53
3 HİZMET YILI
im sure you will probably find an already built program either on github or stackoverflow, its kinda of a common task
 
Üye
Katılım
23 Tem 2022
Mesajlar
6
Tepki puanı
2
Yaş
34
3 HİZMET YILI
search this question on programming sites, I believe you will have your answers, or study more haha
 
Onaylı Üye
Katılım
12 Haz 2022
Mesajlar
50
Tepki puanı
7
Ödüller
1
Yaş
28
3 HİZMET YILI
I found it a little confusing, did you look at the documentation?
 
Üye
Katılım
16 Ağu 2022
Mesajlar
1
Tepki puanı
0
Yaş
25
3 HİZMET YILI
I'm researching for your question or ask to someone of your class
 
Słyszę, słyszę letni powiew.
Kurucu
Katılım
20 Haz 2015
Mesajlar
7,666
Çözümler
136
Tepki puanı
20,724
Ödüller
25
10 HİZMET YILI
C++:
 srand(time(0)); 
    const int secret_number = (rand() % 10) + 1;
    bool matched = false;
    int guessed_number;
    std::printf("Welcome to the game xd. \n");
    while (!matched) {
        cin >> guessed_number;
        if (guessed_number < secret_number) {
            std::printf("Guess was low ! \n");
        }
        else if (guessed_number > secret_number) {
            std::printf("Guess was high ! \n");
        }
        else {
            std::printf("You've found the secret number ! \n");
            matched = true;
        }
    }
1661300793497.png
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst