1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andreyy89
3 years ago
8

Write a Raptor program that will generate a random number between 1 and 100; do not display the randomly generated number. Let t

he user guess within 3 tries what the random number is. Display appropriate messages based on each try, for example, "1 remaining try" or "You guessed correctly!"
Computers and Technology
2 answers:
zepelin [54]3 years ago
8 0

Answer:

Explanation:

Let's do this in Python, we can first generate the random number from 1 to 100. Then compare that with the input number from the guesser.

from random import random

random_0_1 = random()

random_1_100 = 1 if round(100*random_0_1) < 1 else round(100*random_0_1)

for trial in range(3):

    guess = input('Guess the number: ')

    if guess == random_1_11:

         print('You guessed correctly!')

         break

    else:

         print(2 - trial + " remaining try")

tekilochka [14]3 years ago
4 0

Answer:

The answer to this question can be given as:

Program:

#include <stdio.h>  //include header file.

#include <stdlib.h> //include header file.

int main ()  //main method.

{

 int number,choice;  //define variable.

 number = rand() % 10 + 1; //use random function and take value in number variable

 for(int i=1;i<=3;i++)  //loop for 3 time input.  

 {

   printf ("\n Enter the Guess number between 1 to 10 :\n"); //message

   scanf ("%d",&choice); //input a number

   if (number<choice)  //check number

   {

   printf("Number is to lower\n try= %d",i); //message

   }

   else if (number>choice) //check number

   {

   printf("Number is to higher\n try= %d",i);   //message

   }

   else if(number==choice ||number!=choice)  //check number

   {

       printf("Congratulations...! \n You guessed correctly!\n");  //message

       break;

   }

 }

   printf("\n Number is :%d\n",number);  //value

 return 0;

 }

Output:

Enter the Guess number between 1 to 10 :

5

Number is to lower

try= 1

Enter the Guess number between 1 to 10 :

8

Number is to lower

try= 2

Enter the Guess number between 1 to 10 :

6

Number is to lower

try= 3

Number is: 4

Explanation:

The above C language program can be described as:

  • In this program firstly we include header files.  Then we define the main function in this function we define a variable that is number and choice. The number variable holds the value of the random number that is taken by the rand function.
  • Then we define the loop. This loop is used to provide input validation. This means the user input number only three times. In this loop, we take input by the user in the choice variable.  
  • Then we use the conditional statement. In this statement, we check the numbers. If the value match in 3 inputs so, it will print the message "Congratulations...! You guessed correctly!". Otherwise, we will print the random function value.
You might be interested in
______ are used to store all the data in a database.
e-lub [12.9K]

Answer:

C. Fields

Explanation:

Fields are used to store all the data in a database.

6 0
2 years ago
Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
garri49 [273]

Track Changes is a way for Microsoft Word to keep track of the changes you make to a document.To ignore all tracked changes in a document, you should select the Final option, on the Track Changes tab in the Review tab.

On the Review tab, use the little menus in the Tracking group. Final: Show Markup or Original: Show Markup will show what changes you have made.

6 0
3 years ago
Read 2 more answers
CLS <br> N = 1<br> FOR J = 1 TO 5 <br> PRINT N<br> N = 10*N+1 <br> NEXT J<br> END
Lemur [1.5K]

Answer:

1

11

111

1111

11111

Explanation:

Given

The above QBasic code

Required

The output

The iteration on the third line is repeated 5 times; i.e. for values of j from 1 to 5.

In each iteration, the value of N is printed and the next value is calculated.

Initially, the value of N is 1 ---- on line 2

So, 1 is printed first. The next value of N is as follows:

N = 10 * N + 1 --- we keep replacing N (on the right-hand side) with current N value.

So, we have:

N = 10 * 1 + 1 =11

N = 10 * 11 + 1 = 111

N =10 *111+1 = 1111

N =10 *1111+1 = 11111

4 0
3 years ago
Who invented the ENIAC? More than one answer may apply.
andriy [413]

Answer:John Mauchly and Presper Eckert

Explanation:

3 0
3 years ago
Help brainleist giving exam
Digiron [165]

Explanation:

11. True

12: Electronic Fund Transfer

13. True

14. I'm not sure but I think yes?..

(I'm not sure if your including number 15 but just in case, the full form of PIN is personal identification number)

4 0
2 years ago
Other questions:
  • Troubleshooting comes before diagnosing. Answer: false
    7·1 answer
  • How has technology influenced space exploration?
    13·1 answer
  • George, a user, has contacted you to complain that his issue has not been resolved. He has already contacted your department twi
    9·1 answer
  • In presentation software, what is the way that text and pictures are arranged on a page called?
    10·1 answer
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • The rules of right-of-way<br> Pedestrians, bicyclists, and skateboarders<br> when they use the road.
    12·1 answer
  • 14. Which of the following information about the ESRT T-teen rating rating is FALSE?
    15·1 answer
  • Which of the following sentences use personification 
    9·1 answer
  • If the disaster requires actions offsite from the primary infrastructure, it is under the jurisdiction of__________.
    7·1 answer
  • What type of databases is not limited by the data’s physical location?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!