Write a program called nearest_multiple.py that asks the user to input a number (here I will call it num) and a strictly positive integer (here I will call it mult) and prints as output the closest integer to num that is a multiple of mult

Answers

Answer 1

Answer:

The program is as follows:

num = float(input("Enter a decimal (float): "))

mult = int(input("Enter a positive whole (int): "))

small = (num // mult) * mult

big = small + mult

print(num,"rounded to the nearest multiple of ",mult,"is",end=" ")

print(big if num - small > big - num else small)

Explanation:

This gets input for num

num = float(input("Enter a decimal (float): "))

This gets input for mult

mult = int(input("Enter a positive whole (int): "))

This calculates the smaller multiple

small = (num // mult) * mult

This calculates the larger multiple

big = small + mult

This prints the output header

print(num,"rounded to the nearest multiple of ",mult,"is",end=" ")

This prints small if small is closer to num, else it prints big

print(big if num - small > big - num else small)


Related Questions

An OpenCL Device is composed of: Group of answer choices Command Queues Platforms Processing Elements Compute Units

Answers

Answer:

Compute Units

Explanation:

A platform can be defined as a computing environment for building and executing sets of code in a software application or program such as an application programming interface (API).

The two parts of the platform used to run an application software are both hardware and software (operating system).

Machine and assembly are referred to as a low level programming language used in writing software programs or applications with respect to computer hardware and architecture. Machine language is generally written in 0s and 1s, and as such are cryptic in nature, making them unreadable by humans but understandable to computers.

OpenCl is an abbreviation for open computing language that runs on CUDA-powered graphics processing units (GPUs). An OpenCL Device is composed of compute units and an OpenCl compute unit typically comprises of processing elements.

What is the default join type? inner self join left outer right outer

Answers

Answer: inner

Explanation: on edg

Answer:

inner

Explanation:

just did it on Edg

An ISA specifies a word size of 8 bytes, byte addressability, and an address space of 256 K; it uses single-word instructions (i.e. each instruction is a single 8 byte word). What is the size of the MAR

Answers

Answer:

2 bytes

Explanation:

Size of the MAR ( memory address register )  = 18 bits = 2 bytes

Given that

address space = 256 K  = 2^8

number of address location= 2^8  * 2^10       ( where 1K = 2^10 )  

                                              = 2^18

Given the number of address location = 2^18 ;

Hence  18 bits are required to store the address of the instruction

How can you refer to additional information while giving a presentation? will help you emphasize key points on a specific slide. The Notes section is only to you in the Slide view and not in the main Slide Show view.

Answers

Explanation:

1. welcome your audience and introduce yourself.

2. capture their attention

3. identify your number one goal or topic of presentation.

4. give a quick shout out line of your presentation.

5.

candidates should identify at least three different types of information in any one presentation from text, drawing, images, tables, video ,audio .

1-How many moles of NazCOs are in 10.0 ml of a 2.0 M solution?​

Answers

Answer:

A solution is a mixture in which the particles are so small that the components are indistinguishable from each other. The amount of the solute and the solvent in a solution can be expressed in terms of different concentration expressions such as molarity, morality, etc.

Explanation:

To calculate the number of moles of sodium carbonate, the volume in liters will be multiplied by the molar concentration of the solution.

moles Na2CO3 = 2.0 M  x 0.0100 L = 0.020 moles Na2CO3

Hope it helps :)

Answer:

There are 20. mol of Na2CO3 in 10.0L of 2.0M solution.

Explanation:

Molarity is represented by this equation:

(look at attachment)

In our case, we already have the molarity and volume of solution, both of which have good units.

Let's rearrange the equation to solve for the number of moles. We can do this by multiplying by L solution on both sides of the equation. The L solution will cancel out on the right side, leaving the number of moles being equal to the molarity times volume:

Moles of solute

=Lsolution×Molarity

Now we just plug the known values in!

Moles of solute = (10.0 L) (2.0M) = 20. moles

Select all phrases that describe a server-based network. centralized network security easy to expand log-ins controlled by central server unlimited number of users network resources stored on individual workstations

Answers

Answer:

Client Server Network ... is the central computer that enables authorized users to access networked resources ... computers in this type of network are connected to a central hub ... why might a business choose a server based network (3) ... 2) easier to expand ... external hardware connected to and controlled by a computer.

Explanation:

Answer

Explanation:

what the other person said

You wish to traverse a binary search tree in sorted order using pre order traversal. Arrange the following actions in the correct order to accomplish this. I Print the right subtree recursively II Print the root III Print the left subtree recursively

Answers

Answer:

II Print the root

III Print the left subtree recursively

I Print the right subtree recursively

Explanation:

The question illustrates binary search in data structure.

When preorder is applied to a binary search, the search starts by visiting the root node, then proceed to the visiting the left most nodes and finally, the left nodes will be visited.

Using the above illustration, the arrangement of the actions in ascending order is: II, III and I

WHY THE HECK IS BRAINLY SHOWING UNSKIPPABLE ADS!?

I was looking for an answer on brainly and it told me to see an ad. When I clicked on it and waited for the ad to end, it didn't let me skip to the answer. In fact, I doesn't let me through AT ALL. Please fix this.

Answers

I don’t know why you have that

Consider a collection C of subsets of a nite set V . (V; C) is called a hypergraph. A hypergraph (V; C) is 3-regular if every subset in C contains exactly three elements. A subcollection M of C is matching if all subsets in M are disjoint. Show that there exists a polynomial-time 3-approximation for the maximum matching problem in 3-regular hypergraphs as follows: Given a 3-regular hypergraph, find a matching with maximum cardinality.

Answers

Explanation:

polynomial-time 3-approximation for the maximum matching problem in 3-regular hypergraphs as follows: Given a 3-regular hypergraph, find a matching with maximum cardinality.

how do you record your own video game Music and post Them on yt

Answers

Answer:I would try downloading a beat app and making a song,then posting

Explanation:

You should use another electronic and record it from their

Write function d2x() that takes as input a nonnegative integer n (in the standard decimal representation) and an integer x between 2 and 9 and returns a string of digits that represents the base-x representation of n.

Answers

Answer:

The function in Python is as follows:

def d2x(d, x):

   if d > 1 and x>1 and x<=9:

       output = ""

       while (d > 0):

           output+= str(d % x)

           d = int(d / x)

       output = output[::-1]

       return output

   else:

       return "Number/Base is out of range"

Explanation:

This defines the function

def d2x(d, x):

This checks if base and range are within range i.e. d must be positive and x between 2 and 9 (inclusive)

   if d >= 1 and x>1 and x<=9:

This initializes the output string

       output = ""

This loop is repeated until d is 0

       while (d > 0):

This gets the remainder of d/x and saves the result in output

           output+= str(d % x)

This gets the quotient of d/x

           d = int(d / x) ----- The loop ends here

This reverses the output string

       output = output[::-1]

This returns the output string

       return output

The else statement if d or x is out of range

   else:

       return "Number/Base is out of range"

Which of these statements regarding mobile games is true?

A.
They are typically played indoors.
B.
They have detailed environments.
C.
Their levels can be completed quickly.
D.
They are typically played for several hours at a time.
E.
They are played on large screens.

Answers

i have a feelings it’s the one that’s about playing for long lengths of time

Answer:

C. The levels can be completed quickly

#PlatoLivesMatter

Explanation:

George has a set of software programs installed on his computer to create a digital portfolio. He is not sure what each program does. Help George by matching the software to their purposes

Answers

Explanation:

I thinkcreating and edditing Images matchs to adobePhotoshop

Microsoft word is for adding and Creating text document

Creating andeditingpage layout -Adobe In Design

Desktop Publication-QuarkQuark Xpress

I hope thishelp and If wrong Inform me

Good luck

Answer:

This is the answer based off of the notes

Explanation:

Which statement about parallax scrolling is true?

A.
Parallax scrolling distorts the position of the player character when playing the game.
B.
Parallax scrolling involves segmenting the playing area into background layers that move slower than the foreground layers.
C.
Parallax scrolling involves unifying the playing area into a single environment.
D.
Parallax scrolling involves segmenting the playing area into background layers that move faster than the foreground layers.
E.
Parallax scrolling involves segmenting the playing area into background layers and foreground layers that move at the same speed.

Answers

Answer:

The answer is B

Explanation:

I wrote down every slide of this lesson by hand lol. Good luck on the final <3

Develop a sorting algorithm. Your sorting algorithm may only be an implementation of a the shellsort, mergesort, or quicksort. Your algorithm must use an array of integers of at least 20 different items.

Answers

Answer:

Explanation:

The following function is created in Python and uses a mergesort algorithm implementation in order to sort a given array of integers which is passed as an argument. Once complete it returns the sorted array. This can then be printed in the main method as seen in the attached picture below.

def BrainlySort(arr):

   if len(arr) > 1:

       mid = len(arr) // 2 #First find the middle of the array

       # Divide the array into two sections

       left = arr[:mid]

       right = arr[mid:]

       #Sort each section seperately

       BrainlySort(left)

       BrainlySort(right)

       i = j = k = 0

       # Copy data to temp arrays left[] and right[]

       while i < len(left) and j < len(right):

           if left[i] < right[j]:

               arr[k] = left[i]

               i += 1

           else:

               arr[k] = right[j]

               j += 1

           k += 1

       #Make sure no elements are left in the array

       while i < len(left):

           arr[k] = left[i]

           i += 1

           k += 1

       while j < len(right):

           arr[k] = right[j]

           j += 1

           k += 1

b) Set of strings of 0s and 1s whose 5th symbol from left is 1.

Answers

Answer:

...?

Explanation:

Describe a cellular network, its principle
components and how it works.

Answers

A cellular network is a contact network with a wireless last connection. The network is divided into cells, which are served by at least one fixed-location transceiver station each. These base stations provide network coverage to the cell, which can be used to send voice, data, and other types of information. It's often referred to as a mobile network.

The principal components of the cellular network will be explained below as follows-

BTS (Base Transceiver Station) - It is the most important part of a cell since it links subscribers to the cellular network for data transmission and reception. It employs a network of antennas that are dispersed across the cell.

BSC (Basic Station Controller) - It is a portion that interfaces between Basic Station Controllers and is connected to Basic Station Controllers via cable or microwave links, as well as routing calls between Basic Station Controllers and the MSC (Mobile Switching Center).

MSC (Mobile Switching Center) - The supervisor of a cellular network is linked to several Basic Station Controllers and routes cells between them. It also connects the cellular network to other networks such as the PSTN through fiber optics, microwave, or copper cable.

A cellular network works when the SIM card is organized into geographical cells, each of which has an antenna that transmits to all mobile phones in the city, cellular networks operate by knowing the exact location, which comes from the SIM card. A transmitter generates an electrical signal, which is converted by the transmit antenna into an electromagnetic wave, which is then radiated, and the RF wave is then converted back into an electrical signal. In cellular network networks, four multiple access schemes are used, ranging from the first analog cellular technologies to the most modern cellular technologies.

With the addition of electric cars, we have a need to create a subclass of our Car class. In this exercise, we are going to create the Electric Car subclass so that we can override the miles per gallon calculation since electric cars don’t use gallons of gas.
The Car class is complete, but you need to complete the ElectricCar class as outlined in the starter code with comments.
Once complete, use the CarTester to create both a Car and ElectricCar object and test these per the instructions in the CarTester class.
Classes
public class CarTester
{
public static void main(String[] args)
{
// Create a Car object
// Print out the model
// Print out the MPG
// Print the object
// Create an ElectricCar object
// Print out the model
// Print out the MPG
// Print the object
}
}
////////////////////////////
public class ElectricCar extends Car {
// Complete the constructor
public ElectricCar(String model){
}
// Override the getMPG here.
// It should return: "Electric cars do not calculate MPG.
// Override the toString() here.
// (model) is an electric car.
}
//////////////////////////////////
public class Car {
//This code is complete
private String model;
private String mpg;
public Car(String model, String mpg){
this.model = model;
this.mpg = mpg;
}
public String getModel(){
return model;
}
public String getMPG(){
return mpg;
}
public String toString(){
return model + " gets " + mpg + " mpg.";
}
}

Answers


Hey will you please help me with my essay and I’ll get back to yours please ASAP//

Imagine running a 64-bit system on a 32-bit system, where we simulate a single 64- bit memory location (register) using two atomic 32-bit memory locations (registers). A write operation is implemented by simply writing the first 32-bits of the simulated 64-bit register in the first real register, then the second 32-bits in the second real register. A read, similarly, reads the first half from the first register, then the second half from the second register, and returns the concatenation. What is the strongest property that this 64-bit register satisfies: safe, regular, or atomic

Answers

Answer:

It's not possible to ensure memory access occurs indivisibly when it has to broken into multiple operations. Unfortunately, the fact that your application is running on a 64-bit kernel does not change the equation any - it is actually running in a compatibility layer and has none of the benefits of x64

Explanation:

Blockquote
The page contains a review within a block quote. Go to the Blockquote Styles section and create a style rule for theblockquote element that sets the background color to rgb(173, 189, 227) and the text color to the rgb(255, 255, 255) with an opacity of 0.65.
For every paragraph within the blockquote element create a style rule that sets the top/bottom padding space to 2.5 pixels and the left/right padding space to 10 pixels.
My Code
/* Blockquote Styles */
blockquote {
background-color:rgb(173,189,227);
color:rgb(255,255,255);
opacity:0.65;
}
blockquote > p {
padding: (2.5, 10, 2.5, 10);
}

Answers

Answer:

I don't knowthe answer

Explanation:

I really don't know the answer

what is internet? explain help pliz​

Answers

The Internet, sometimes called simply "the Net," is a worldwide system of computer networks -- a network of networks in which users at any one computer can, if they have permission, get information from any other computer (and sometimes talk directly to users at other computers).

When adding several user accounts, you might want to use the newusers utility, which can process a text file full of entries to add user accounts. Use the man or info page to find out how to use this utility, and use it to add three users. When finished, view the /etc/passwd, /etc/shadow, and /etc/group files to verify that the users were added successfully.

Answers

Explanation:

Given - When adding several user accounts, you might want to use the new users utility, which can process a text file full of entries to add user accounts.

To find - Use the man or info page to find out how to use this utility, and use it to add three users.

Proof -

New Users Utility:

It is an utility which reads the file full of usernames and clear text passwords.

It then uses this information to update a group of the existing users to create new users.The format of the file consists of specified things like:

pw - passwd

pw - age

pw - gid

pw - dir

Use of the Utility:

The command is new users filename

The file should look like -

(Username : Password : UID : GID : User Information : Home Directory : Default Shell)

where ,

UID = User Identifier

GID = Group Identifier

Testing the Users:

Creating users from the file given above test User 1, directory Of File

Executing the create user new users directory Of File

Repeat this step to undergo all the users that are been noted down in the file to make them a user in the noted group policy.

Hence,

These are the steps of using the new Users utility.

Which of the following is not one of the goals of technical recovery team members during the recovery phase of a BCP? Normalize operations. Restore temporary operations to critical systems. Repair damage done to original systems. Recover damage to original systems.

Answers

Answer:

Repair damage done to original systems

Explanation:

It is imperative that businesses brace up for moments or period of challenges whereby normal operation is impeded due to disruption in standard system condition. The ability of businesses to thrive and continue to deliver in these circumstances is catered for by the business continuity plan. The recovery team ensures that important processes critical to the business are restored in other to ensure that business operation isn't crippled. Once normalcy ahs been restored, the team ensures recoverabke day in the original system are taken care of. The repair of damage done is not a goal of the recovery ohase in the business continuity plan as repairsvare catered for after recovery event has been finalized.

hardware and costs of adding two levels of hardware RAID. Compare their features as well. Determine which current operating systems support which RAID levels. Create a chart that lists the features, costs, and operating systems supported.

Answers

Explanation:

1. Redundant batch of Inexpensive Drives (or Disks) (RAID) is a term for data storage schemes that divide and/or replicate data amid multiple hard drives.

2. RAID can be designed to provide increased data accuracy or increased Input/Output performance

Hardware RAID exists as a customized processing system, utilizing various controllers or RAID cards to control the RAID design independently from the OS. Software RAID utilizes the processing capacity of that computer's operating system in which the RAID disks exists installed.

What are the two types of RAID?

We have two kinds of RAID implementation through. Hardware and Software. Both these implementation contains its own benefits and drawbacks.

Software RAID does not count any cost for a RAID controller and exists fairly effortless to estimate the cost of as you exist only buying additional drives. All of our usual dedicated servers come with at least two drives, indicating there exists NO cost for software RAID 1, and stands positively suggested.  It exists positively suggested that drives in a RAID array be of the exact type and size. With RAID 0 or RAID 1, you'd require at least two drives, so you would require to buy one additional drive in most cases. With RAID 5 you'll require at least three drives, so two additional drives, and with RAID 6 or 10 you'd require at least four total drives. To earn additional implementation, redundancy, or disk space, you can count more disks to the collections as well.

To learn more about two types of RAID

https://brainly.com/question/19340038

#SPJ2

You work for a large company that has over 1000 computers. Each of these computes uses a wireless mouse and keyboard. Therefore, your company goes through a lot of alkaline batteries. When these batteries can no longer power the intended device, you must decide what to do with them. Unless otherwise dictated by your local authorities, which of the following would be the EASIEST way to deal with these batteries?
They must be sent to hazardous waste collection

a. They can be recharged.
b. They must be stored onsite until they expire
c. They can be thrown in the trash.

Answers

The answer to this question is, "They can be thrown in the trash."

Explanation: This is because it specifies how to get rid of them UNLESS local authorities have told you otherwise.

Evaluation of your strengths and weaknesses
a. Self Assessment b. Employee
c. Entrepreneurship d. Entrepreneur

Answers

いt  背lfまyべラテぇrべit is a lolololol idek ima just stop

2. What is software conflict?

Answers

Answer:

A problem that occurs when two programs cannot run in the same computer at the same time. It is generally due to a programming bug and typically manifests when two programs compete for the same resource (memory, peripheral device, register, etc.).

Hope it helps out!

Explanation:

Write a function called csv_sum that takes a filename and returns the sum of all of the numbers in the file. The numbers are in csv format. For instance, if the contents of the file are: 12,3,2 -5 10,20,-10,8.3 Then the function should return 40.3.

Answers

Answer:

Explanation:

def csv_sum(filename):

   total = 0

   try:

       f = open(filename)

       for line in f:

           words = line.strip().split(",")

           for word in words:

               total += float(word)

       f.close()

   except FileNotFoundError:

       pass

   return total

help me guys plssssss​

Answers

Answer     The answer is

                                   

                           So hope this was helpful

Explanation:

What is the technology in community​

Answers

Answer:

Community technology is the practice of synergizing the efforts of individuals, community technology centers and national organizations with federal policy initiatives around broadband, information access, education, and economic development. National organizations efforts include: Developing effective language.

Community technology is a principled approach to technology that is grounded in the struggle for a more just digital ecosystem, placing value on equity, participation, common ownership and sustainability. In these activities, participants will use social analysis to understand technologies we use. Hope this helped!
Other Questions
helllppp porfavor:,)x/9=15/2 rounded to the nearest tenth20/8.7=5.8/x to the nearest tenth5/16=11/x nearest tenthx/0.06=17/0.5 to the nearest tenth29/x=75/44 GEOMETRY PLS HELPWHATS THE VOLUME WILL MARK BRAINLIST GOD BLESS Suppose that prices of a gallon of milk at various stores in one town have a mean of $3.69 with a standard deviation of $0.11. Using Chebyshev's Theorem, what is the minimum percentage of stores that sell a gallon of milk for between $3.47 and $3.91 Need Help I plsssssssssssssss on the verge of failing and i desperately need help/please :(( Five applicants are to be scheduled for job interviews at five given times. On an application form, each applicant was asked to mark two out of the five times. What is the probability that each of them can be interviewed at one of the two times they have marked What were the benefits of the Japanese having a relationship with the U.S.? What was the main goal of the Free Soil Party? O A. To promote free land for farmers B. To preserve the Union C. To stop the spread of slavery D. To encourage slavery in the territories Which action is considered nonconsensual? O sex between two 18-year-olds o sex between a married couple O sex with an incapacitated person O sex with a partner who is older PLEASE HELP, ASAP, Thank you! 4. The route for Millburn's Fourth of July parade stretches 2 miles (10,560 feet).Spectators are usually evenly distributed along both sides of the route. Along oneside of 50 feet of the route, you count 15 children. Estimate the number of childrenwho attended the parade.PLEASEEE HELP Find angle 1,2,3, and 4 please and thank you Which of the following correctly identifies the function of the given cell component What was one goal of Pan-Africanism? A user is working with the range titled "Emp_Info as shown in the Excel file below. outlander spices - table In cell C6, the user has typed in the function =VLOOKUP(A6,Emp_Info,5,false). If the user does a VLOOKUP using Employee ID E007, what should appear in cell C6? A. East B. 000-78-8906 C. Accounts D. Melissa James Solve the system of equations with graph as given below. Write the solution as an ordered pair (x, y). Thirty percent of the immigrant population settled in which Western state?A. CaliforniaB. ArizonaC. New MexicoD. Texas!!NO LINKS PLEASE AND PROPER ANSWER!! One advantage of a matched subjects design is: Group of answer choices A. Individuals do not have to be randomly assigned. B. Everything is automatically counterbalanced. C. That error variance is decreased. D. There are no individual differences. Estimate 16.82-8.264 by first rounding each number to the nearest tenth.pls help i need the right answer! If your bodys hypothalamus is not functioning properly, which of the following will happen?