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
IrinaK [193]
2 years ago
6

Write a program using integers user_num and x as input, and output user_num divided by x three times.Ex: If the input is:20002Th

en the output is:1000 500 250Note: In Python 3, integer division discards fractions. Ex: 6 // 4 is 1 (the 0.5 is discarded).LAB ACTIVITY2.29.1: LAB: Divide by x0 / 10main.pyLoad default template...12''' Type your code here. '''
Computers and Technology
1 answer:
HACTEHA [7]2 years ago
5 0

Answer:

Following are the code to the given question:

user_num = int(input())#defining a variable user_num that takes input from user-end

x = int(input())#defining a variable x that takes input from user-end

for j in range(3):#defining for loop that divides the value three times

   user_num = user_num // x#dividing the value and store integer part

   print(user_num)#print value

Output:

2000

2

1000

500

250

Explanation:

In the above-given program code two-variable "user_num and x" is declared that inputs the value from the user-end and define a for loop that uses the "j" variable with the range method.

In the loop, it divides the "user_num" value with the "x" value and holds the integer part in the "user_num" variable, and prints its value.  

You might be interested in
While working alone at their constant rates computer X can process 240 files in 4 hours, and comp Y 240 files in 8 hrs. If all f
djverab [1.8K]

Answer:

2hrs 40 min

Explanation:

3 0
3 years ago
Read 2 more answers
Effective nonverbal communication can cause tension.<br><br> True or False
agasfer [191]

Explanation:

When your nonverbal signals match up with the words you're saying, they increase trust, clarity, and rapport. When they don't, they can generate tension, mistrust, and confusion.

4 0
3 years ago
Keep true , never be ashamed of doing right decide on what you think is right and stick to it.
Doss [256]
This is the quote of T.S. Eilot
5 0
3 years ago
The cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.
Sonbull [250]

Answer:

The following alterations are done to the program

1. Replace <em>/* Your solution goes here */ </em>with

<em>const int CENTS_PER_POUND = 25;</em>

<em>cout<<"Ship Weight Pounds: "; </em>

<em>cin>>shipWeightPounds; </em>

<em />

2. Include

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;</em>

after

<em>cout << ", Cents per lb: " << CENTS_PER_POUND;</em>

Explanation:

<em>See attachment for complete program as it should be ordered</em>

<em></em>

This line declares CENTS_PER_POUND as a constant integer and it also initializes the variable to 25

<em>const int CENTS_PER_POUND = 25;</em>

This prompts the user for the weight of the shipping items (in pounds)

<em>cout<<"Ship Weight Pounds: "; </em>

<em />

This gets user input for  the weight of the shipping item

<em>cin>>shipWeightPounds; </em>

<em />

<em>.............................</em>

<em>........</em>

<em>...</em>

This calculates the cost of shipping the item

<em>shipCostCents = FLAT_FEE_CENTS + CENTS_PER_POUND * shipWeightPounds;</em>

Download cpp
6 0
2 years ago
Write a script that creates and calls a stored procedure named test. This procedure should use a transaction that includes the s
natita [175]

Answer:

Check the explanation

Explanation:

use `my_guitar_shop`;

#delete the procedure test if it exists.

DROP PROCEDURE IF EXISTS test;

DELIMITER //

CREATE PROCEDURE test ()

BEGIN

   #declare variable sqlerr to store if there is an sql exception

  declare sqlerr tinyint default false;

   #declare variable handler to flag when duplicate value is inserted

  declare continue handler for 1062 set sqlerr = TRUE;

   #start transaction

   start transaction;

  delete from order_items where order_id in

      (select order_id from orders where customer_id=6);

  delete from orders where customer_id=6;

  delete from addresses where customer_id=6;

  delete from customers where customer_id=6;

 

   if sqlerr=FALSE then

      commit;

        select 'Transaction Committed' as msg;

  else

       rollback;

       select 'Transaction rollbacked' as msg;

   end if;

end //

delimiter ;

call test();

8 0
3 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • Wordwrap forces you to stop typing words and press the enter key at the end of each line.
    12·1 answer
  • What advantage do ExpressCard modules and U.S.B adapters offer over expansion cards?
    10·1 answer
  • What quantities are measured by the following sensors:
    9·1 answer
  • The data-linking feature that allows Internet users to skip directly from a highlighted word to a related file in another comput
    12·2 answers
  • A collection of computers, printers, routers, switches, and other devices
    15·1 answer
  • GMI = $4,666.67 Total Monthly Deductions $1,131.00 What is the Net Monthly Income (GMI - Total Monthly Deductions) =
    9·1 answer
  • When should you stop where you are, drop to the
    11·1 answer
  • Use the drop-down menus to complete statements about audio file formats.
    10·1 answer
  • In java I need help on this specific code for this lab.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!