Write a template that accepts an argument and returns its absolute value. The absolute entered by the user, then return the total. The argument sent into the function should be the number of values the function is to read. Test the template in a simple driver program that sends values of various types as arguments and displays the results.

Answers

Answer 1

Answer:

In python:

The template/function is as follows:

def absval(value):

   return abs(value)

Explanation:

This defines the function

def absval(value):

This returns the absolute value of the argument using the abs() function

   return abs(value)

To call the function from main, you may use:

print(absval(-4))


Related Questions

mips Write a program that asks the user for an integer between 0 and 100 that represents a number of cents. Convert that number of cents to the equivalent number of quarters, dimes, nickels, and pennies. Then output the maximum number of quarters that will fit the amount, then the maximum number of dimes that will fit into what then remains, and so on. If the amount entered is negative, write an error message and quit. Amounts greater than 100 are OK (the user will get many quarters.) Use extended assembly instructions and exception handler services.

Answers

Answer:

Explanation:

The following code is written in python and divides the amount of cents enterred in as an input into the correct amount of quarters, dimes, nickels and pennies. Finally, printing out all the values.

import math

#First we need to define the value of each coin

penny = 1

nickel = 5

dime = 10

quarter = 25

#Here we define the variables to hold the max number of each coin

quarters = 0

dimes = 0

nickels = 0

pennys = 0

cents = int(input("Please enter an amount of money you have in cents: "))

if cents > 0 and cents <= 100:

   if cents >= 25:

       quarters = cents / quarter

       cents = cents % quarter

   if cents >= 10:

       dimes = cents/dime

       cents = cents % dime

   if cents >= 5:

       nickels = cents /nickel

       cents = cents % nickel

   if cents > 0:

       pennys = cents / penny

       cents = 0

   print("The coins are: "

       "\nQuarters", math.floor(quarters),

       "\nDimes", math.floor(dimes), "\nNickels", math.floor(nickels), "\nPennies", math.floor(pennys))

else:

   print("wrong value")

Basic python coding, What is the output of this program? Assume the user enters 2, 5, and 10.
numA = 0
for count in range(3):
answer = input ("Enter a number: ")
fltAnswer = float(answer)
numA = numA + fltAnswer
print (numA)
Thanks in advance!
:L

Answers

Answer:

17.0

Explanation:

I ran it for you. You could also try that (go to replit).

QUESTION 1
Which of the following is an example of firewall?
O a. Notepad
b. Bit Defender internet Security
O c. Open Office
O d. Adobe Reader

Answers

Answer is Bit defender Internet security
B

Michael needs to ensure that those items that are automatically archived are still easily accessible within Outlook. Which option should he configure?

Answers

Answer:

show archive in folder list

Answer:

d

Explanation:

how to be safe through internet? and what is e safety definition and what are the the rules of e safety pls pls I will give u 74 points lessgooo ​

Answers

Here are the Top 10 Internet safety rules to follow to help you avoid getting into trouble online (and offline).

1. Keep Personal Information Professional and Limited

Potential employers or customers don't need to know your personal relationship status or your home address. They do need to know about your expertise and professional background, and how to get in touch with you. You wouldn't hand purely personal information out to strangers individually—don't hand it out to millions of people online.

2. Keep Your Privacy Settings On

Marketers love to know all about you, and so do hackers. Both catsometimes(detsometimes hard to find because companies want your personal information for its marketing value. Make sure you have enabled these privacy safeguards, and keep them enabled.

3. Practice Safe Browsing

You wouldn't choose to walk through a dangerous neighborhood—don't visit dangerous neighborhoods online. Cybercriminals use lurid content as bait. They know people are sometimes tempted by dubious content and may let their guard down when searching for it. The Internet's demimonde is filled with hard-to-see pitfalls, where one careless click could expose personal data or infect your device with malware. By resisting the urge, you don't even give the hackers a chance.

4. Make Sure Your Internet Connection is Secure. Use a Secure VPN Connection

When you go online in a public place, .Careful What You Download

A top goal of cybercriminals is to trick you into downloading malware—programs or apps that carry malware or try to steal information. This malware can be disguised as an app: anything from a popular game to something that checks traffic or the weather. As PCWorld advises, don't download apps that look suspicious or come from a site you don't trust

6. Choose Strong Passwords

Passwords are one of the biggest weak spots in the whole Internet security structure, but there's currently no way around them. And the problem with passwords is that people tend to choose easy ones to remember (such as "password" and "123456"), which are also easy for cyber thieves to guess. Select strong passwords that are harder for cybercriminals to demystify. Password manager software can help you to manage multiple passwords so that you don't forget etc... .....

follow me entrust

Answer:

안녕

from my opinion don't tell anyone anything about you like be anonymous

and if anyone ask you where u live say earth he /she will think u became angry or for example you said to person 1 ( you stay in England )

but to person 2 ( say to stay in Japan )

but it's good to say nothing about you not even your name or age

I HOPE YOU UNDERSTAND ENGLISH IF NOT I CAN REWRITE IT IN KOREAN

What are input masks most useful for in data validation? moving data from one field to another hiding parts of a value that are unnecessary identifying duplicate values in different records in a table ensuring consistent formatting of values in a specific field

Answers

Answer:

Ensuring Consistent Formatting of Values in a Specific Field

Explanation:

Answer: ensuring consistent formatting of values in a specific field

Explanation: on edg

A slide contains three text boxes and three images that correspond to the text boxes. Which option can you use to display a text box with its
image, one after the other, in a timed sequence?
A. transition
В. table
C. animation
D. slide master
E. template

Answers

The answer is A. Transition.

Answer:

animation

Explanation:

jettison folk 2007, Magnum opus, be moving, offers poisoned commentary on the film industry.

Answers

Answer:

I'm a little confused...

Explanation:

Can you reword this please?

I need help solving this problem on Picoctf. The question is What happens if you have a small exponent? There is a twist though, we padded the plaintext so that (M ** e) is just barely larger than N. Let's decrypt this: ciphertext. The ciphertext is this. I tried using stack flow and the rsatool on GitHub but nothing seems to work. Do you guys have any idea of what I can do. I need to solve this problem asap

Answers

Explanation:

Explanation:

RSA encryption is performed by calculating C=M^e(mod n).

However, if n is much larger than e (as is the case here), and if the message is not too long (i.e. small M), then M^e(mod n) == M^e and therefore M can be found by calculating the e-th root of C.

what is the economic and ideological causes of the American, the French,and the Chinese revolutions, and to see the larger historical contexts in which these events took place?​

Answers

Answer:

Explanation:The French who had direct contact with the Americans were able to successfully implement Enlightenment ideas into a new political system. The National Assembly in France even used the American Declaration of Independence as a model when drafting the Declaration of the Rights of Man and the Citizen in 1789.

Suppose you observe that your home PC is responding very slowly to information requests from the net. And then you further observe that your network gateway shows high levels of network activity, even though you have closed your email client., Web browser, and other programs that access the net. What types of malware could cause these symptoms

Answers

ANSWER: BOT

EXPLANATION: When a PC is experiencing the listed effects, it thus depicts that the PC is under attack by a bot, which is a type of script or software application that establishes automated tasks via command.

However, a bad bots often initiate malicious tasks that gives room for attackers to take control over an affected PC remotely, most especially for fraudulent activities.

When several affected computers are connected, they form a botnet connection.

Which examples demonstrate common qualifications for Marketing Information Management and Research careers? Check all that apply.

David has the physical strength to lift products on high shelves.
Alessandra analyzes and interprets information she gathered from surveys.
Eve is good at presenting and explaining information to others.
Franklin is a strong leader who is able to motivate others.
Gene is very organized and tracks information accurately and carefully.
Claire is confident and persuasive, which makes her good at selling products.

Answers

Answer:

2,3,5

Explanation:

Answer: the answer is 2 3 and 5

Explanation:

how do i work this out? does anyone do programming?

Answers

Answer : No sorry ..

Mikolas is doing a research on U.S. visas for a school project. He has found conflicting information on two sites. The first site is travel.state.gov and the other is traveldocs.com. Which site should Mikolas trust more?

Traveldocs.com

Travel.state.gov

Answers

Answer:

Travel.State.Gov

Explanation:

This is a government website explaining visas which should be very well trusted. However, traveldocs.com could be made by any person who does or doesn't know what they're talking about.

What is the proper order for the fetch-execute cycle?

Answers

Control Unit – controls all parts of the computer system. It manages the four basic operations of the Fetch Execute Cycle as follows:

Fetch – gets the next program command from the computer’s memory

Decode – deciphers what the program is telling the computer to do

Execute – carries out the requested action

Store – saves the results to a Register or Memory

Arithmetic Logic Unit (ALU) – performs arithmetic and logical operations

Register – saves the most frequently used instructions and data

User defined blocks of code can be created in
Snap using the
feature.
A. make a block
B. duplicate
C. create
D. define a function

Answers

D....................

If you are insured with third party insurance, it will cover which costs?

A. business losses due to a denial-of-service attack
B. loss of data in your laptop because of a coffee spillover
C. ransomware attack on your laptop
D. costs related to lawsuits, and penalties due to a cyberattack

Answers

Answer:

c.

Explanation:

Answer: D (costs related to lawsuits, and penalties due to a cyberattack)

Explanation: Third Party insurance covers the liabilities of policyholders to their clients or customers. Regulatory: It covers the cost related to legal affairs, lawsuits and penalties due to a cyberattack.  

Write an instance method in Rational called add that takes a Rational number as an argument, adds it to this, and returns a new Rational object. There are several ways to add fractions. You can use any one you want, but you should make sure that the result of the operation is reduced so that the numerator and denominator have no common divisor (other than 1).

Answers

Answer:

Explanation:

I do not have the Rational class but based on the information provided, the following class has been tested and does what is requested. It can simply be added to the Rational class and it will work fine. Due to technical difficulties I had to add the instance method as an attachment in a text file down below.

what is a . com in a web address mean

Answers

Answer:

dot commercial

Explanation:

.edu education

.gov goverment

Answer:

Commercial

Explanation:

Software as a Service (SaaS) allows users to
remotely access which of the following? Check all
of the boxes that apply.

software

data

applications

Answers

Answer:

Data software provides the best and most powerful software that allows you in the class

Answer:

software

data

applications

(all)

Explanation:

Which option would allow you to watch an HD video, without delays in playback, on a computer with a Mac OS and a connection that has a lower bit rate? MPG QuickTime H.264 Flash Player

Answers

Answer:

H.264

Explanation:

A file type can be defined as the standard used to store digital data such as pictures, texts, videos, and audios. They all have unique file extension which determines the type of software program (application) to be used for opening a particular file and accessing its data e.g pictures (jpeg, png), texts (txt, docx, rtf), audios (mp3, acc), and videos (mp4, 3gp, avi, h.264, mkv).

Sometimes, computer users make the mistake of opening files with the wrong software application or program, this often leads to an error due to the incompatibility of the software application with the particular file.

H.265 is a high efficiency video codec (HEVC) and it's a standard video compression codec designed and developed to offer a better data compression, as an upgrade to the advanced video coding (AVC) standard.

Hence, the option or file extension (format) which would allow you to watch a high definition (HD) video, without delays in playback, on a computer with a Mac operating system (OS) and a connection that has a lower bit rate is the H.264 format.

what is a software house​

Answers

Answer:  a company whose primary products are various forms of software, software technology, distribution, and software product development. They make up the software industry.

this should be the answer

hoped this helped

Which are the 2 main elements that’s make up computer architecture?

Answers

Answer:

Explanation:

Computer architecture is made up of two main components the Instruction Set Architecture (ISA) and the RTL model for the CPU.

....................

Answers

Answer:

*

* *

* * *

* * * *

* * * * *

i did it i guess?

PLEASE DO THIS QUESTION IN PYTHON
You will write two programs for this endeavor. The first will be a class definition module, and
the second will be the driver program. (Remember the naming rules for these modules!)
The class module should contain the following:
1. An initializer method that accepts two parameters (other than self):
a. A parameter corresponding to the name of the food
b. A parameter corresponding to the amount of the food (in pounds) to order
However, the initializer method should contain four hidden attributes:
a. The name of the food - to be updated using the food parameter
b. The amount in pounds - to be updated using the amount parameter
c. The standard price of the food item per pound - to be updated using a private
method
d. The calculated price of the ordered item (based on amount ordered) – to be
updated using a public method
2. A private method that will store the list of items and their price per pound (in other
words, the information provided in the table above). The method accepts no
parameters (other than self) and returns no value. Use an if-elif structure to set the
standard prices of the food. Reference the hidden attributes of food name and standard
price to set the prices.
Use the header of the method is (provided below) as well as the pseudocode to
complete this method:
#use this header (note the __ before the name)
def __PriceList(self):
if foodname is 'Dry Cured Iberian Ham' #write in actual python
then standardprice is 177.80
#complete the method…
Make sure to include a trailing else that sets the price to 0.00 if an item that is not on
the table is referenced (or if an item is misspelled J )
3. A public method to calculate the cost of the ordered food. The cost should be calculated
using the formula:
Amount of food (in pounds) x price per pound
The method accepts no parameters (other than self), but returns the calculated cost.
4. Accessors as needed (or an __str__ method if you prefer).
The driver program will import the class module you created. This module should contain the
following components:
1. A function that creates a list of objects. The function accepts no parameters but returns
the list of objects. The function should:
a. Create an empty list.
b. Prompt the user for the number of items. This value will be used to determine
the number of repetitions for a necessary loop. (Make sure to include input
validation to ensure that the number of items purchases is at least 1.)
c. Contain a loop that prompts the user for the name of the item and the amount
of the item in pounds. (Make sure to include input validation to ensure that the
number of pounds is greater than 0.) The loop should use this information to
create an object, and append the object to the list
d. Returns the list (once the loop is completed)
2. A function to display the contents of the list. This function accepts a list of objects as a
parameter but does not return a value. The function should:
a. display the contents of each object in the list (all 4 attributes). Make sure to
include appropriate formatting for prices.
3. A function that calculates the total cost of all items. Recall, your object will only have the
cost of each item (based on the amount of pounds ordered for that item). This function
accepts the list of objects as a parameter and returns a value. This function should:
a. access the individual cost of each ordered item
b. calculate the total cost of all the items in the list
c. return the total cost
4. A main function. Your main function should:
a. Call the three aforementioned functions
Dry Cured Iberian Ham $177.80
Wagyu Steaks $450.00
Matsutake Mushrooms $272.00
Kopi Luwak Coffee $317.50
Moose Cheese $487.20
White Truffles $3600.00
Blue Fin Tuna $3603.00
Le Bonnotte Potatoes $270.81

Answers

Answer:

Explanation:

This is a project. This is not Brainly material. Just sink your teeth into it and do your best. I definitely would not rely on some stranger on the Internet to give me a good program to turn in for this project anyway. Just start coding and you'll be done before you know it.

Can two computers be assigned to one IP address

Answers

Answer:

two computers cannot have the same public (external) IP address unless they are connected via the same router. If they are connected via the same router, then they can have (share) the same public IP address yet have different private (local) IP addresses

Explanation:

Answer: maybe

Explanations: two computers cannot have the same public (external) IP address unless they are connected via the same router. If they are connected via the same router, then they can have (share) the same public IP address yet have different private (local) IP addresses.

Why is dark supereffective against ghost? (AGAIN)

I don't get it. I get why it is supereffective against psychic, because even the greatest minds are scared of criminal activities, but why would it be good against ghost?
AND GIVE ME AN ACTUAL ANSWER THIS TIME. DON"T ANSWER IF YOU DON"T KNOW OR IF YOUR ANSWER ISN'T IN ENGLISH.

Answers

Answer: Think of it in this way: People often warn others not to speak badly of the Dead. Why? This is because, it is believed that their souls get "restless", and this causes them to haunt others. Thus, Dark type moves, that symbolise the "evil" aspect of the Pokemon, are super-effective against Ghosts. Type chart, effectiveness and weakness explained in Pokémon Go

Type Strong Against Weak Against

Bug Grass, Psychic, Dark Fighting, Flying, Poison, Ghost, Steel, Fire, Fairy

Ghost Ghost, Psychic Normal, Dark

Steel Rock, Ice, Fairy Steel, Fire, Water, Electric

Fire Bug, Steel, Grass, Ice Rock, Fire, Water, Dragon

Explanation: hopes this helps

What type of information is best suited for infographies?​

Answers

Answer:

All varieties of information, from bullet pointed text to numerical tables

Explanation:

Answer:

All varieties of information, from bullet pointed text to numerical tables

Explanation:

Me Completan Pliiiis

Answers

Answer:

its in Spanish most people cant read Spanish

Explanation:

You are going to visit a national park, and have never been there before. You are using a map to try and make the distance travelled as short as possible. There are 5 intermediate towns, A, B, C, D, and E, you may gln your way to the park, and the distances between the various locations are given below.

Answers

Answer:

eggs fishing didn't ysjffj

Other Questions
The grasshopper and the bell cricketWhich statement best reflects the narrator's perspective in the text?A. Lessons of childhood are often lost in adulthood.B. Treat nature and children with the respect they deserve.C. Be careful of giving your heart to others.D. Learn to forget the mistakes of the past. what are the three limitations of an ELISA Mario has gross biweekly earnings of $784.21. By claiming 1 more withholding allowance, Mario would have $13 more in his take home pay. How many withholding allowances does Mario currently claim?a. 3b. 4 Calculate the amount of copper in moles in a 27.5g pure copper sheet Stacey's Piano Rebuilding Company has been operating for one year. At the start of the second year, its income statement accounts had zero balances and its balance sheet account balances were as follows:Cash $6,800 Account payable $8,900Account receivable $30,300 Unearned revenue $3,640Supplies $1,490 Note payable (long term) $47,600Equipment $9,700 Common stock $196Land $7,500 Retained earnings $14,150Building $26,600 Additional paid-in capital $784a. Rebuilt and delivered five pianos in January to customers who paid $19,100 in cash.b. Received a S530 deposit from a customer who wanted her piano rebuilt.c. Rented a part of the building to a bicycle repair shop; received $910 for rent in January.d. Received $7,200 from customers as payment on their accounts.e. Received an electric and gas utility bill for $520 to be paid in February.f. Ordered $920 in supplies.g. Paid $2,040 on account in January.h. Received from the home of Stacey Eddy, the major shareholder, a $980 tool (equipment) to use in the business in exchange for 120 shares of $1 par value stock.i. Paid $14,700 in wages to employees who worked in January.j. Declared and paid a $1,600 dividend (reduce Retained Earnings and Cash).k. Received and paid cash for the supplies in (f).Required:Prepare an income statement for January 31. Help me please.. there is no option on here for Human Resources principals, so I jus clicked business as the subject.. Which statement best describes Desmond Tutu?He was a politician who lifted the long-standing ban on the African National Congress.He was sent to prison on various charges for protesting South Africas policies of apartheid.He was the president of South Africa in 1990 and pushed reforms that ended apartheid.He was a religious leader who called for international sanctions against South Africa.Which statement best summarizes this quotation?He regrets his actions and hopes the court will spare his life.He is angry at the government for falsely accusing him.He believes that sabotage is a rational response to the apartheid system.He believes that his actions should have no consequences. In which country would this sign have been used A consumer has an income of m available for expenditure on two goods. The price of good 1 is p and the price of good 2 is one. If he consumes x 0 units of good 1 and y 20 units of good 2, his utility is: u(x, y) = 1+x (y + 1), where (0, 1) and (0, 1). We also assume that m > a/B. (a) Derive the consumer's marginal rate of substitution (MRS)xy between x and y. (b) Write down the Lagrangian function for the utility maximisation problem and obtain the first-order conditions. (c) Suppose that the second order conditions are satisfied. Solve the first-order conditions to obtain the consumer's demands for x and y as functions of p and m. Explain where you use the assumption m> a/B. (d) Determine the effect of an increase in m on the consumption of y. (e) Using economics intuition, find the optimal consumption of y if m Heather paid $37.50 for a pizza to be delivered to her house. She had a coupon for 30% off andthere is a tax of 8%. What was the total cost of the pizza to be delivered? How does Communism interfere with Capitalism? Think about the news story. Which fits best in the empty box above? Press enter to interact with the item, and press tab button or down arrow until reaching the Submit button once the item is selected A Three children were part of a group that danced in Greece. B Dancers gave a special underwater performance in Greece. C Composer Trifonas Koutsourelis created music for a show. D Dancers wore different kinds of scuba gear for a show the first person to follow localmiray on tictoc and copy and paste those emojis into the answer box gets brainly Make a box and whicker plot of the following prices of some DVDs. {10.99, 12.99, 15.99, 10.99, 26.99, 14.99, 19.99, 19.99, 9.99, 21.99, 20.99) Which of thefollowingDECREASESas you go UP amountain?A. climateB. altitudeC. amount of oxygenD. buoyancy PPE stands forPathogen Protecting EquiqmentPersonal Protective EquipmentPersonal Pathogen Equipment An electrician deposits $6000 in a bank account with 7% simple interest. What is the total balance after 4 years? easy 10 points please answer The following information is available: Units in process, Dec. 1 (60 percent converted) 2,000 units Units in process, Dec. 31 (30 percent converted) 1,000 units Units started during the month 7,500 units Materials are added at the beginning of the process. How many equivalent units in process for conversion were there in December using the weighted average method? Group of answer choices Expand 3(n + 7) show FULL work