1. Engineering
  2. Computer Science
  3. write a program that uses a scanner object that reads...

Question: write a program that uses a scanner object that reads...

Question details

Write a program that uses a Scanner object that reads a month followed by three doubles that represent 3 days of temperatures (all on one line). Then calculate the average temperature and print the month and average temperature. Do not concern yourself with controlling the display of the decimal point.

Note: you can use the Scanner method next() to read in a single String.

Input

1 month (as a string) and 3 temperatures (as doubles) all on one line.

Output

The average temperature (as a double).

Example

July 32.5 27 29.7
Average temperature in July: 29.733333333333334

Use Java

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution