Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

please here is my python lab screenshot of simple statistics

# 4.19 LAB: Simple Statistics

## Objective
Given 4 floating-point numbers, you will use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers.

## Instructions
1. **Output Each Rounded Integer:**
   Use the following method:
   ```python
   print('{:.0f}'.format(your_value))
   ```

2. **Output Each Floating-Point Value with Three Digits After the Decimal Point:**
   Use the following method:
   ```python
   print('{:.3f}'.format(your_value))
   ```

## Example
If the input is:
```
8.3
10.4
5.0
4.8
```

The output should be:
```
2072 7
2071.680 7.125
```

## Lab Activity
- **Title:** 4.19.1 LAB: Simple Statistics

### Code Template (main.py)
```python
num1 = float(input())
num2 = float(input())
num3 = float(input())
num4 = float(input())

''' Type your code here. '''
```

### Instructions
- You will write code following the given skeleton, which will calculate the desired outputs and format them as specified.
- Make sure to replace the placeholder with the logic that computes the product and average of the four numbers, formats them correctly, and prints them accordingly.
expand button
Transcribed Image Text:# 4.19 LAB: Simple Statistics ## Objective Given 4 floating-point numbers, you will use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers. ## Instructions 1. **Output Each Rounded Integer:** Use the following method: ```python print('{:.0f}'.format(your_value)) ``` 2. **Output Each Floating-Point Value with Three Digits After the Decimal Point:** Use the following method: ```python print('{:.3f}'.format(your_value)) ``` ## Example If the input is: ``` 8.3 10.4 5.0 4.8 ``` The output should be: ``` 2072 7 2071.680 7.125 ``` ## Lab Activity - **Title:** 4.19.1 LAB: Simple Statistics ### Code Template (main.py) ```python num1 = float(input()) num2 = float(input()) num3 = float(input()) num4 = float(input()) ''' Type your code here. ''' ``` ### Instructions - You will write code following the given skeleton, which will calculate the desired outputs and format them as specified. - Make sure to replace the placeholder with the logic that computes the product and average of the four numbers, formats them correctly, and prints them accordingly.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education