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]
3 years ago
14

Need 2.5 Code Practice Answers

Computers and Technology
2 answers:
konstantin123 [22]3 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]3 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
3 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
On your Web page, you include various links and clickable images that have the ability to trigger various functions when users c
denis23 [38]

Answer:

Event is the correct answer to the given question.

Explanation:

Because when user clicks from the mouse on the image or any link then the clickable event triggered the various function. Event one of the essential part of DOM. It is an important event in the JavaScript. When the left button of the mouse is clicked on the images or links which are clickable then the mouseup event occurs.

HTML contains the set if an events when the user click on the clickable events then the JavaScript code are triggered

4 0
3 years ago
What symbol indicates that a cell is not wide enough to display its numbers ?
Yuki888 [10]

Answer:

Option D is correct. A pound sign is used to indicates that a cell is not wide enough to display its numbers.

Explanation:

A pound sign symbol indicates that a cell is not wide enough to display its number in Excel. However, it is noted that if you use or installed a US keyboard in your computer then hash symbol (#) is shown and the pound sign symbol is shown if you use or installed the UK keyboard layout in your computer.

Why other options are not correct.

  • An Asterisk symbol:

this symbol is used for multiplication in formula or in a cell to multiply the numbers with each other.

  • A dollar sign:

A dollar sign is used in a cell to show the currency. If you want to show the cell value as a currency. Then, you can use the dollar sign.

  • Percentage Sign

Percentage sign in the cell shows that value in a cell is representing a percentage of some values.

3 0
3 years ago
Read 2 more answers
The establishment called ABC Enterprise requires a Java program to keep a database of the inventory of the products that it sell
Alexandra [31]

Answer:

// GetData.java

import javax.swing.JOptionPane;

public class GetData

{

  public static double getDouble(String s)

  {

      return Double.parseDouble(getWord(s));

  }

  public static int getInt(String s)

  {

      return Integer.parseInt(getWord(s));

  }

  public static String getWord(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

  public static String getString(String s)

  {

      return JOptionPane.showInputDialog(s);

  }

}

// Address.java

public class Address

{

  private String street, city, state, zip;

  public Address(String str, String city, String st, String zip)

  {

      street = str;

      this.city = city;

      state = st;

      this.zip = zip;

  }

  public String getStreet()

  {

      return street;

  }

 

  public String getCity()

  {

      return city;

  }

  public String getState()

  {

      return state;

  }

  public String getZip()

  {

      return zip;

  }

}

// Manufacturer.java

public class Manufacturer

{

  private String companyName;

  private Address companyAddress;

 

  public Manufacturer()

  {

      this.companyName = "";

      this.companyAddress = null;

  }

 

  public Manufacturer(String compName, Address address)

  {

      this.companyName = compName;

      this.companyAddress = address;

  }

 

  public String getCompanyName()

  {

      return companyName;

  }

 

  public void setCompanyName(String companyName)

  {

      this.companyName = companyName;

  }

 

  public Address getCompanyAddress()

  {

      return companyAddress;

  }

 

  public void setCompanyAddress(Address address)

  {

      this.companyAddress = address;

  }

}

// Product.java

import java.text.SimpleDateFormat;

import java.util.Date;

public class Product

{

 

  SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");

 

 

  Manufacturer manufacture;

 

 

  String productName;

 

 

  int quantity;

 

 

  double unitPrice;

 

 

  Date productCreated;

 

 

  public Product()

  {

      this.productName = "";

      this.quantity = 0;

      this.unitPrice = 0.0;

      this.productCreated = null;

      this.manufacture = null;

  }

 

  public Product(String prodName, int quantity, double unitPrice,

                        Date productCreated, Manufacturer manufact)

  {

      this.productName = prodName;

      this.quantity = quantity;

      this.unitPrice = unitPrice;

      this.productCreated = productCreated;

      this.manufacture = manufact;

  }

 

 

  public Date getProductCreated()

  {

      return productCreated;

  }

 

 

  public void setProductCreated(Date productCreated)

  {

      this.productCreated = productCreated;

  }

 

  // to get the Manufacturer object

  public Manufacturer getManufacture()

  {

      return manufacture;

  }

 

  // to set the Manufacturer object

  public void setManufacture(Manufacturer manufacture)

  {

      this.manufacture = manufacture;

  }

 

  // to get the name of the product

  public String getProductName()

  {

      return productName;

  }

 

  // to set the name of the product

  public void setProductName(String prodName)

  {

      this.productName = prodName;

  }

 

  // to get the quantity of the product

  public int getQuantity()

  {

      return quantity;

  }

 

  // to set the quantity of the product

  public void setQuantity(int quantity)

  {

      this.quantity = quantity;

  }

 

  // to get the unit price of the product

  public double getUnitPrice()

  {

      return unitPrice;

  }

 

  // to set the unit price of product

  public void setUnitPrice(double unitPrice)

  {

      this.unitPrice = unitPrice;

  }

 

  // to update the quantity of the product

  public void upDateQuantity(int quantity_upDate)

  {

      quantity += quantity_upDate;

  }

 

  // to update the price of the product

  public void upDatePrice(double price_upDate)

  {

      this.unitPrice = price_upDate;

  }

 

 

  public String getProductInfomation()

  {

      String result = "";

      result += String.format("%-30s", productName);

      String dateForm = sdf.format(productCreated);

      result += String.format("\t %s", dateForm);

      result += String.format("%10d", quantity);

      result += String.format("\t%15.2f", unitPrice);

      result += String.format("\t%15s",

                          manufacture.getCompanyName());

      result += String.format("\t%20s",

                 manufacture.getCompanyAddress().getState());

      return result;

  }  

}

Explanation:

  • Create a manufacturer class to store and get information about company name and company address.
  • Create a product class to hold the manufacturer object, product name and other relevant information.
4 0
3 years ago
An 8x16 font isstored in _________________ bytes.<br> ? 8<br> ? 16<br> ? 4<br> ? 20
stiv31 [10]

Answer:

The answer to this question is 16 bytes.

Explanation:

8x16 font means it contains 16 rows by 8 columns of 1-bit pixel ( picture element ).

rows=16.

columns=8.

8 bit = 1 byte.

8x1 = 1 byte.

8x16 = 16 bytes.

So 8x16 font size requires 16 bytes of data to store a character.Hence we conclude that the answer is 16 bytes.

8 0
3 years ago
If you enter a command and want to terminate its execution before it is finished, you can press ____ to do so.
sertanlavr [38]
If you mean on the phone you can press the home button. if you mean on the computer you could press esc
5 0
3 years ago
Read 2 more answers
Other questions:
  • Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number an
    12·1 answer
  • 5) How have the wireless web and peer-to-peer networking helped small businesses compete with large corporations?
    15·2 answers
  • Write an UPDATE statement that modifies the InvoiceCopy table. Change the PaymentDate to today’s date and the PaymentTotal to th
    7·1 answer
  • Most engines will contain how many cylinders in order to maintain a proper balance of weight and forces?
    12·2 answers
  • Study the sentences below. A.Changing the properties of characters in a sentence or paragraph in a Word document helps increase
    5·2 answers
  • Martha wants to create an image for her Web site. Martha should use _____.
    15·2 answers
  • Lucy wants to add some notes in her research paper that provide additional information to the reader. She also wants to display
    14·1 answer
  • How do i voice record on my (acual ipod itself) ipod nano 4th generation helppppppp
    9·1 answer
  • What is stored in studentScores after running the program code?
    5·1 answer
  • What should be taken into consideration when determining which critical information should be protected?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!