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
Paladinen [302]
2 years ago
14

Need 2.5 Code Practice Answers

Computers and Technology
2 answers:
konstantin123 [22]2 years ago
4 1

Answer:

import random

random.seed(1,10)

a = random.randint (1,10)

b = random.randint (1,10)

print ("What is: " + str(a) + " X " + str(b) + "?")  

ans = int(input("Your answer: "))  

if (a * b == ans):  

   print ("Correct!")  

else:  

   print ("Incorrect!")

Explanation:

iragen [17]2 years ago
3 1

Answer:

import random

#random.seed() should not be used here as this method will produce same number again and again

a = random.randint(1,11) #this method will generate random number between 1 and 10  

b = random.randint(1,11)

print ("What is: " + str(a) + " X " + str(b) + "?")  

ans = int(input("Your answer: "))

if (a * b == ans):

   print ("Correct!")

else:

   print ("Incorrect!")

Output :

What is: 8 X 5?

Your answer: 40

Correct!

Explanation:

  • First for producing random numbers,random module has to be imported.
  • As mentioned in answer, random.seed() method is used to generate same random number again and again. Here we need to generate 2 different random numbers that is why we won't use this method.
  • To produce a random number, randint() method from random module is used. This method takes 2 parameters i.e. a low and high value. The low value is inclusive and the high value is exclusive. That is why , to get a number between [1,10], randint() takes 1 as low value(inclusive) and 11 as high value(exclusive).

Elo Lemon
2 years ago
This literally doesn’t work, I copy and pasted it into python and I get an EOD error when reading a line, help?!
You might be interested in
Rebecca is creating a method for her class, but wants to make sure that a variable in the method satisfies a conditional phrase.
astraxan [27]

Answer:

D. an assertion

From PLATO

6 0
2 years ago
20 examples of input device?
kiruha [24]

Answer:

Computer keyboard,Microphone,Image scanner,Touchscreen,light pen

Explanation:

sorry  that   all  device i  know

8 0
3 years ago
Read 2 more answers
How does the luminosity of this star compare with that of the other three (hip 87937, hip 108870, and tau cet)?
Afina-wow [57]

Answer:

Regulus is the most luminous. Regulus is the least luminous

Explanation:

  • Transcribed image text: Of the three stars you've observed (HIP 87937, HIP 108870, and Tau Cet), which one is more luminous?
  • View Available Hint(s) Tau Cet O HIP 87937 O HIP 108870
  • They have the same luminosity.

To learn more about it, refer

to https://brainly.in/question/413163

#SPJ4

6 0
1 year ago
Game Design Help please
valina [46]
This game on cool math
4 0
3 years ago
Print Job Cost Calculator (10 points)
Ad libitum [116K]

Answer: Provided in the explanation section

Explanation:

Provided is the code  to run this program

Source Code:

import java.util.Scanner;

class PrintJobCost

{

  public static void main(String[] args) {

      Scanner input=new Scanner(System.in);

      System.out.print("Enter print job info:");

      String info=input.nextLine();

      String size="",type="";

      int count=0,i=0,len=info.length();

      double cost=0.0;

      while(info.charAt(i)!=' '){

          size=size+info.charAt(i);  

          i++;

      }

      i++;

      while(info.charAt(i)!=' '){

          type=type+info.charAt(i);

          i++;

      }

      i++;

      while(i<len){

          count=count*10+Integer.parseInt(String.valueOf(info.charAt(i)));

          i++;

      }

      if(size.equals("Letter"))

          cost=cost+0.05;

      else if(size.equals("Legal"))

          cost=cost+0.06;

      else if(size.equals("A4"))

          cost=cost+0.055;

      else if(size.equals("A5"))

          cost=cost+0.04;

      if(type.equals("Grayscale"))

          cost=cost+0.01;

      else if(type.equals("Colored"))

          cost=cost+0.10;

      cost=cost*count;

      System.out.printf("print job Cost:$ %.2f\n",cost);

  }

}

cheers i hope this helped !!!

8 0
3 years ago
Other questions:
  • 1. The graphical representation of the users character of alter ego is their:
    11·1 answer
  • I need a idea of a origami for my coding class and it needs to be easy to make
    15·2 answers
  • A(n) ________________ takes place when an unauthorized person gains access to a digital device by using an internet connection a
    10·1 answer
  • Which statements describe the use of styles in Word? Check all that apply.
    11·2 answers
  • What’s the purpose of balancing or monitoring your checking account?
    12·2 answers
  • Examination of Internet records in order to reveal the identity of an anonymous poster is defined as
    13·1 answer
  • Microsoft's ____ is one of the major web-based development environments.
    12·1 answer
  • The disk you inserted was not readable by this computer
    11·1 answer
  • Which of the expressions is false? when a = 10 and b = 4
    8·1 answer
  • **HELP ME PLS**
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!