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

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

product as integers, then as floating-point numbers. Ex: If the input is 10.3 20.4 5.0 Then the output is: 11 1050 11.900000 1050.600000
Computers and Technology
1 answer:
kodGreya [7K]3 years ago
6 0

Answer:

number1 = float(input("Enter the first number: "))

number2 = float(input("Enter the second number: "))

number3 = float(input("Enter the third number: "))

avg = (number1 + number2 + number3) / 3

product = number1 * number2 * number3

print("Average - Product with integer numbers: " + str(int(avg)) + " " + str(int(product)))

print("Average - Product with float numbers: %.6f %0.6f" % (avg, product))

Explanation:

- Get three numbers from the user

- Calculate the average of the numbers

- Calculate the product of the numbers

- Print average and product of the numbers in required format

You might be interested in
"Which of the following will help protect against a brute force attack?
Effectus [21]

Answer:

B

Explanation:

A complex and unpredictable password would prove very hard to guess or deduce for any attacker.

3 0
4 years ago
Write a method named numUnique that accepts a sorted array of integers as a parameter and that returns the number of unique valu
SVEN [57.7K]

Answer:

The method in Java is as follows:

public static int numUnique(int list[]) {  

int unique = 1;  

for (int i = 1; i < list.length; i++) {  

 int j = 0;  

 for (j = 0; j < i; j++) {

  if (list[i] == list[j])  

   break;  

 }

 if (i == j)  

  unique++;  

}  

return unique;  

}  

Explanation:

This line defines the numUnique method

public static int numUnique(int list[]) {

This initializes the number of unique elements to 1

int unique = 1;  

This iterates through the list

for (int i = 1; i < list.length; i++) {

The following iteration checks for unique items

 int j = 0;  

<em>  for (j = 0; j < i; j++) { </em>

<em>   if (list[i] == list[j]) </em><em>If current element is unique, break the iteration</em><em> </em>

<em>    break;  </em>

<em>  } </em>

 if (i == j)  

  unique++;  

}

This returns the number of unique items in the list

return unique;  

}  

3 0
3 years ago
In an input file, what maintains the location of the next item that will be read from the file?
Semmy [17]

The Read Position marks the location of the next item that will be read from the file.

6 0
4 years ago
A specific packet journey, from your computer to a remote server, end-to-end across multiple networks, has the following link ba
MrRa [10]

Answer:

0.125 seconds

Explanation:

The formula for the time taken to transfer the file is = file size / bandwidth

Assuming the computer and server could only transfer data at the speed of 1000 Mbps or more, The time of transmission is;

= 125 MB / 1000 Mbps = 0.125 seconds.

3 0
3 years ago
Good HTML skills will be required in order to prevent what from happening in the design of a web page?
Verizon [17]

Answer:

to properly use the tags in the web page

Explanation:

The full form HTML is Hyper Text Mark up Language. HTML is used in designing a good web page in the computer. It is used to design the document that are displayed in the web browser.

Instead of using a programming language to do the functions of a web page, the markup language uses the tags to identify the different types of the contents and purposes that they serve in the web page. A good HTML skills are required to prevent the web page from any improper designing of the contents in the web page.

5 0
3 years ago
Other questions:
  • What's usually kept in database?
    7·2 answers
  • What does this mean?
    7·2 answers
  • What is computer Network?​
    14·2 answers
  • Can anyone give me $2 (Reddem code/Promo Code)​
    15·2 answers
  • Choose the answer that best completes the
    8·2 answers
  • List how much hard disk capacity you recommend, and write a sentence explaining why.
    8·1 answer
  • What is another name for control structure <br> Object<br> Sequence<br> Loop<br> Decision
    8·1 answer
  • Who is considered as the father of computer science?​
    11·1 answer
  • Josh is learning about hackers know for finding loopholes in systems, without notifying the company or organization beforehand.
    13·1 answer
  • Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!