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
stepan [7]
3 years ago
10

Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their

average as integers (rounded), then as floating-point numbers. Output each rounded integer using the following: print('{:.0f}'.format(your_value)) Output each floating-point value with three digits after the decimal point, which can be achieved as follows: print('{:.3f}'.format(your_value))
Computers and Technology
1 answer:
Mama L [17]3 years ago
5 0

Answer:

The program is as follows:

prod = 1

isum = 0

for i in range(4):

   num = float(input())

   prod*=num

   isum+=num

avg = isum/4

print('{:.0f}'.format(prod))

print('{:.3f}'.format(avg))  

Explanation:

This initializes the product to 1

prod = 1

..... and sum to 0

isum = 0

The following iteration is repeated 4 times

for i in range(4):

Get input for each number

   num = float(input())

Calculate the product

   prod*=num

Add up the numbers

   isum+=num

This calculates the average

avg = isum/4

Print the products

print('{:.0f}'.format(prod))

Print the average

print('{:.3f}'.format(avg))  

You might be interested in
(blank) is an expansion card that enables a computer to connect to a network:
laiz [17]

Answer:

A

Explanation:

7 0
2 years ago
Can someone help me with these questions on linear dimensions pls
andrew-mc [135]
Size dimentions reffer to overall dimentions and will tell the overall width, lenth height and depth of something location dimentions means the locatuon of each geometric shape.
7 0
3 years ago
Read 2 more answers
given:an int variable k,an int array currentMembers that has been declared and initialized,an int variable memberID that has bee
Oksi-84 [34.3K]

Answer:

// The code segment is written in C++ programming language

// The code segment goes as follows

for (k = 0; k < nMembers; k++)

{

//check if memberID can be found in currentMembers

if (currentMembers[k] == memberID){

// If yes,

// assigns true to isAMember

isAMember = true;

k = nMembers;

}

else{

isAMember = false;

// If no

// assigns false to isAMember

}

}

// End of segment:

The following assumption were made in the code segment above.

There exists

1. An already declared and initialised int array currentMembers.

2. An already initialised int variable memberID

Line 3 initiates a loop to scan through the array

Line 6 checks for the condition below

If current element of array equals memberID then

It assigns true to isAMember and nMembers to k

Else

It assigns false to isAMember

7 0
3 years ago
An IT code of conduct is a written guideline that helps determine whether a specific computer action is which of the following?
nadezda [96]
The answer to the question above is the last option: ETHICAL. The IT code of conduct, which is a written guideline, helps in determining whether a specific action is acceptable or ETHICAL. Basically, the IT code of conduct's purpose here is to maintain that the actions being done to the accepted and proper practices.
8 0
4 years ago
A doorknob is an example of which simple machine?
Zarrin [17]
A doorknob is an example of a:
D. Wheel and Axle. 
I hope this helped ^_^
3 0
3 years ago
Read 2 more answers
Other questions:
  • Answer all 3 right an get 15 points 1. What is pinhole photography? 2. What are the three ways that a person can manipulate ligh
    5·1 answer
  • Why do generated backup scripts usually include backticks around names such as database names and column names?
    5·1 answer
  • Error: 404 Not Found <br>The resource that you requested does not exist on this server.
    14·2 answers
  • On what basis can you categorize the generations of computers?
    11·1 answer
  • Which tag provides information about a web site?
    12·1 answer
  • Which is an example of correct HTML? &lt;h1&gt; This is a heading&lt;/h1&gt;
    9·2 answers
  • Where the heck is the leader board?
    5·1 answer
  • The picture above is a description of the C code below. Please modify the C below so that it uses FILE HANDLING (fopen, fputs, f
    5·1 answer
  • Carbohydrates are a huge source of
    7·2 answers
  • If your tired but still need to proofread your document,what should you do?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!