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
vfiekz [6]
3 years ago
6

Part 1 Given 3 integers, output their average and their product, using integer arithmetic. Ex: If the input is 10 20 5, the outp

ut is: 11 1000 Note: Integer division discards the fraction. Hence the average of 10 20 5 is output as 11, not 11.666666666666666. Submit the above for grading. Your program will fail the test cases (which is expected), until you complete part 2 below but check that you are getting the correct average and product using integer division. Part 2 Also output the average and product, using floating-point arithmetic. Ex: If the input is 10 20 5, the output is: 11 1000 11.666666666666666 1000.0
Computers and Technology
1 answer:
MaRussiya [10]3 years ago
6 0

Answer:

a = int(input("Enter first number: "))

b = int(input("Enter second number: "))

c = int(input("Enter third number: "))

avg = (a + b + c) / 3

product = a * b * c

print(str(int(avg)) + " " + str(product))

print(str(avg) + " {:.1f}".format(product))

Explanation:

*The code is in Python

Ask the user for three integers, a, b, and c

Calculate their average, sum the numbers and divide by 3

Calculate their product

Print avg and product as integer numbers, be aware that I type casted the avg to int

Print avg and product as floating point numbers, be aware that I used format method to print one decimal for product

You might be interested in
Write the logical Expression and Draw the Truth table for the <br> following questions
Alja [10]

The logical expressions are

  • (X NOR Y ) OR Z ⇒ (\bar X  \bar + \bar Y) + Z
  • (A NAND B) AND NOT C ⇒ (\bar A \bar \cdot\bar B) \cdot \bar C

<h3>How to determine the logical expressions?</h3>

<u>Logical expression 1</u>

X and Y are linked by the NOR gate.

So, we have:

X NOR Y

The X NOR Y is linked to Z by the OR gate.

So, we have:

(X NOR Y) OR Z

Hence, the logical expression is (X NOR Y ) OR Z ⇒ (\bar X  \bar + \bar Y) + Z

<u>Logical expression 2</u>

A and B are linked by the NAND gate.

So, we have:

A NAND B

The A NAND B is linked to C by the AND gate.

So, we have:

(A NAND B) AND C

Hence, the logical expression is (A NAND B) AND NOT C ⇒ (\bar A \bar \cdot\bar B) \cdot \bar C

See attachment for the truth tables

Read more about truth tables at:

brainly.com/question/27989881

#SPJ1

6 0
2 years ago
What is the name of the book farrah gray published in 2005??
seropon [69]
He wrote Reallionaire
8 0
3 years ago
Does anybody play nitro type
vlabodo [156]

Answer: Nah

Explanation: it kinda sucks and is a waste of time, play better games lol

3 0
3 years ago
Read 2 more answers
To remove white space, double-click this icon.
sweet [91]
Follow these steps:<span>Click the Microsoft Office Button, and then click Word Options.
In the left pane, click Customize.In the Choose commands from list, click All Commands.<span>
Click White Space Between Pages, click Add, and then click OK.
The White Space Between Pages option will appear on the Quick Access Toolbar.</span></span>(google)
I hope I answered your question!
4 0
3 years ago
What advantages do teams have for solving problems
monitta

Answer:

Teams are diverse.

Explanation:

Teams have great advantage in problem solving over single person. A single persons's thinking is one dimensional. He sees and analyse things according to his perspective and understanding which limits his ability to solve problems .On the other hand team consist of multiple people with multiple background and perspective. Everyone has its own thinking process and it's own perspective, there fore in teams if one person is missing some perspective someone else might be looking in to that perspective which greatly enhance teams problem solving

4 0
3 years ago
Other questions:
  • To copy the formatting of one control to other controls, use the ____ button on the form design tools format tab.
    7·1 answer
  • What is the fastest way to locate a record for updating?
    6·1 answer
  • The
    6·2 answers
  • You would like to put the data in order by product number. What should you do?
    15·1 answer
  • What type of version of visual studio is the visual studio express
    8·1 answer
  • What is an operating system?<br>​
    11·2 answers
  • Question 8 (True/False Worth 3 points)
    15·1 answer
  • How to convert meters to centimeters in c programming​
    8·1 answer
  • The pinky finger on the right hand types _____.
    15·2 answers
  • Uh can somebody help me
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!