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
tigry1 [53]
3 years ago
13

mystery_int_1 = 3 mystery_int_2 = 4 mystery_int_3 = 5 You may modify the lines of code above, but don't move them! Above are thr

ee values. Run a while loop until all three values are less than or equal to 0. Every time you change the value of the three variables, print out their new values all on the same line, separated by single spaces. For example, if their values were 3, 4, and 5 respectively, your code would print: 2 3 4 1 2 3 0 1 2 -1 0 1-2 -1 0
Computers and Technology
1 answer:
hodyreva [135]3 years ago
6 0

Answer:

The solution code is written in Python

  1. import random
  2. mystery_int_1 = 3  
  3. mystery_int_2 = 4  
  4. mystery_int_3 = 5
  5. print(str(mystery_int_1) + " " + str(mystery_int_2) + " " + str(mystery_int_3))
  6. while(mystery_int_1 > 0 or mystery_int_2 > 0 or mystery_int_3 > 0 ):
  7.    mystery_int_1 = random.randint(-5, 5)  
  8.    mystery_int_2 = random.randint(-5, 5)  
  9.    mystery_int_3 = random.randint(-5, 5)  
  10.    print(str(mystery_int_1) + " " + str(mystery_int_2) + " " + str(mystery_int_3))

Explanation:

Firstly import random module (Line 1).

Next, create three variables to hold the three mystery numbers (Line 3-5). Display the first set of three mystery numbers in one line (Line 6).

While any one of the three mysteries number  still bigger than zero, the while loop will keep going (Line 8). In the loop, three new mystery numbers will be generated using the randint method (Line 9-11). We presume the random value is in range -5 to 5. Print the new set of mystery number on the same line (Line 12).  

You might be interested in
Write an algorithm to check whether the given number is divisible by 2,3 and 6 or not​​
olga2289 [7]

Answer:

Start

Input n, 2

Calculate if (n%2==0) then is divisible else not divisible

Output number is divisible or not

Stop

Explanation:

3 0
3 years ago
How to beat level 50 in give up robot 2
LiRa [457]

Answer:

just follow the steps and and become tough calm but tough

3 0
3 years ago
The specific gravity of gold is 19.3. Write a MATLAB program that will ask the user to input the mass of a cube of solid gold in
s344n2d4d5 [400]

Answer:

Check the explanation

Explanation:

<em>Cube.m:</em>

mass = input("Enter the mass of cube [kilograms]: ");

if(mass<=0)

disp("Error: Mass must be greater than zero grams")

else

fprintf("The length of one side of cube is %.2f inches",2.7*mass);

end

<em>Output1</em>

octave:2> source ( Cube.m Enter the mass of cube [kilograms]: octave:2>-3 Error: Mass must be greater than zero grams

<em />

7 0
4 years ago
1.1. (30 points) Write a program to calculate the average number of cars sold by a car agency over a period of years for the fir
mario62 [17]

Answer:

count = 0

months = 0

years = int(input("Enter the number of years: "))

for year in range(1, years+1):

   cars_sold = int(input("Enter the number of cars sold in first six months: "))

   count += cars_sold

   months += 6

print("Number of months: " + str(months))

print("Number of cars sold in total: " + str(count))

print("Average number of cars sold per month: " + str(count / months))

Explanation:

Initialize the variables

Ask the user for the number of years

Create a for loop that iterates depending on the given number of years

Ask the user for the number of cars sold in the first six months of the year

Increment the count by given number and increment the months by 6 after each iteration

Print the months, count and, average

8 0
3 years ago
I’m quitting this thing so I’m giving all my points away which are 218!!! I’m still gonna have more tho just in case I ever need
Sedaia [141]

Answer:

skdjdishsjsbsisjsjsjsjsnssnsjsjsjsjsjsjjskdxkjdsisi

4 0
3 years ago
Read 2 more answers
Other questions:
  • If you touch a downed power line covered or bare, what’s the likely outcome?
    10·2 answers
  • Which course must first-time drivers in Florida take to be eligible for their Learner License?
    11·1 answer
  • The ability to keep web page visitors at your site is called _______.
    11·1 answer
  • Q.No.3. A filling station (gas station) is to be set up for fully automated operation. Drivers swipe their credit card through a
    10·1 answer
  • How many cells does the organism have?\
    5·2 answers
  • In order to generate a random number, you must use Math.random( ). Group of answer choices True False
    9·1 answer
  • What gaming PC should I get
    14·2 answers
  • It is the application of knowledge
    7·1 answer
  • Any correct answers will be helpful.
    13·1 answer
  • Which of the following best describes the impact of Creative Commons?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!