answer.
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
ser-zykov [4K]
2 years ago
13

1.21 LAB: Divide by x

Computers and Technology
2 answers:
dangina [55]2 years ago
3 0

Answer:

Explanation:

The following code is written in Python. It is a function called divide_by_x and takes the user inputs as described. It then raises x to the third power and divides user_num by that number. This gives the same result as user_num divided by x three times. The answer is saved in the variable answer which is then returned to the user.

def divide_by_x(user_num, x):

   answer = user_num / (x**3)

   return answer

Feliz [49]2 years ago
3 0

Answer:

Explanation:

So I am pretty new to scripting so what I have is inelegant but it worked.

user_num = int(input())

x = int(input())

t1 = user_num//x

print(user_num//x, end = ' ')

t2 = t1//x

print(t1//x, end = ' ')

t3 = t2//x

print(t2//x, end = '\n')

You might be interested in
Square a Number This is a practice programming challenge. Use this screen to explore the programming interface and try the simpl
yan [13]

Answer:

import java.io.*;

public class Main {

  public static void main(String[] args) throws IOException {

      BufferedReader brObject = new BufferedReader(new InputStreamReader(System.in));

      String str;

      while ((str = brObject.readLine()) != null) {

          int number = Integer.parseInt(str);

          System.out.println(number * number);

      }

  }

}

Explanation:

  • Inside the main method, create an object of BufferedReader class to read lines from standard input.
  • Declare a string and run a while loop until it reaches the end of the input.
  • Inside the while loop convert the string into an integer data type.
  • Finally display the output by squaring the number.
3 0
2 years ago
Declare a struct named PatientData that contains two integer data members named heightInches and weightPounds. Sample output for
boyakko [2]

Answer:

struct PatientData{

   int heightInches, weightPounds;

};

Explanation:

In order to declare the required struct in the question, you need to type the keyword <em>struct</em>, then the name of the struct - <em>PatientData</em>, <em>opening curly brace</em>, data members - <em>int heightInches, weightPounds;</em>, <em>closing curly brace</em> and <em>a semicolon</em> at the end.

Note that since the object - lunaLovegood, is declared in the main function, we do not need to declare it in the struct. However, if it was not declared in the main, then we would need to write <em>lunaLovegood</em> between the closing curly brace and the semicolon.

8 0
2 years ago
What is the data transmission time, assuming no errors or overhead, to send a 2 GByte file over a link with a 2 Gbps line rate?
schepotkina [342]

Answer:

The data transmission time will be 8 seconds (8.0s)

Explanation:

Using the formular:

T =A/S

T=Time = ?

Amount of Data = A = 2GByte

Speed = S = 2Gbps

The units of A and S are different

A is expressed in Bytes(B)

S is expressed in bits(b)

But :

1 Byte(B) = 8 bits(b)

T = A/S = 2GB/2Gb

since 1 Byte = 8 bits

T = 2 × G ×( B =8bits) / 2 × G × b

T = 2 × G × 8b / 2 × G × b

T = 2 × G × 8 × b / 2 × G × b

The common terms(2,G,b) cancel out

T = 8 seconds

4 0
2 years ago
Which of the following is true of how packets are sent through the internet?
horrorfan [7]

Answer:

It is A: Packet metadata is used to route and reassemble information travelling  through the internet.

Explanation:

Step 1: The Internet works by chopping data into chunks called packets. Each packet then moves through the network in a series of hops. Each packet hops to a local Internet service provider (ISP), a company that offers access to the network -- usually for a fee

Step 2: Entering the network

Each packet hops to a local Internet service provider (ISP), a company that offers access to the network -- usually for a fee.

Step 3: Taking flight

The next hop delivers the packet to a long-haul provider, one of the airlines of cyberspace that quickly carrying data across the world.

Step 4: BGP

These providers use the Border Gateway Protocol to find a route across the many individual networks that together form the Internet.

Step 5: Finding a route

This journey often takes several more hops, which are plotted out one by one as the data packet moves across the Internet.

Step 6: Bad information

For the system to work properly, the BGP information shared among routers cannot contain lies or errors that might cause a packet to go off track – or get lost altogether.

Last step: Arrival

The final hop takes a packet to the recipient, which reassembles all of the packets into a coherent message. A separate message goes back through the network confirming successful delivery.

3 0
2 years ago
Read 2 more answers
Assume that two parallel arrays have been declared and initialized: healthOption an array of type char that contains letter code
eduard

/*

Since we have to check the first two options only as mentioned in last part of question the loop will work 2 times only and will compare the cost of first element and second and assign the healthoption accordingly

*/

for(int i =0;i<=1;i++){

if(annualCost[i]<annualCost[i+1]

best2 = healthOption[i]

else

best2 = healthOption[i+1]

}

6 0
2 years ago
Other questions:
  • Which statement best describes how the rapid prototyping model works?a) Developers create prototypes to show stakeholders how va
    11·2 answers
  • When a button is selected, the computer processes the code contained in the buttons ____ event procedure?
    12·1 answer
  • Which process is used to protect transmitted data in a vpn?
    12·1 answer
  • In what year were graphical user interfaces (GUIs) pioneered? 1969 1974 1991 2001
    12·2 answers
  • ______ is a certification program that recognizes sustainable building practices and strategies. Question 1 options: A) Brundtla
    10·1 answer
  • Templates contain common layout and formatting that can save you time by not having to recreate documents from scratch. True or
    10·1 answer
  • while investigating the settings on your SOHO router, you find two IP address reported on the devices's routing table, which is
    5·1 answer
  • The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
    10·1 answer
  • A ______________ deals with the potential for weaknesses within the existing infrastructure to be exploited.
    10·2 answers
  • Exercise 3: Function Write a function named word_count that accepts a string as its parameter and returns the number of words in
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!