019-003-002
Data Class: Temperature Record
Easy
Problem Description
Data class: Temperature Record
In this problem, you will create a program that defines a class with three fields (location, temperature, and time), stores data read from standard input into an instance of that class, and displays the result to standard output.
Learning Objective: Structure and manage measurement data with class
Create class to manage temperature measurement records. Bundle three pieces of information into one class: location, temperature, and time, giving "meaning" to the data.
Input
Line 1: Location (string)
Line 2: Temperature (integer)
Line 3: Time (string, HH:MM format)
Output
Temperature Record:
Location: [location]
Temperature: [temperature]°C
Time: [time]
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
Tokyo 25 14:30
Expected Output:
Temperature Record: Location: Tokyo Temperature: 25°C Time: 14:30
Normal case
Input:
Osaka -5 06:00
Expected Output:
Temperature Record: Location: Osaka Temperature: -5°C Time: 06:00
Your Solution
Current Mode:● My Code
TemperatureRecord.java🔒
Solution.java🔒
2/6 ファイル137B
9
1
2
›
⌄
public class TemperatureRecord {
}
0 B / 5 MB
You have 10 free executions remaining
