002-003-010
Converting String to Double
Easy
Problem Description
Converting String to Double
In this problem, you will create a program that reads a string from standard input, converts it to a double using Double.parseDouble(), doubles the value, and displays the result to standard output.
Learning Objective: Understand how to convert strings to decimals using Double.parseDouble()
Overview
Convert a decimal string received from standard input to a number and perform calculations.
Specifications
- Read one line of string from standard input
- Convert the string to a double
- Double the converted value
- Output the result
Input Format
A string representing a decimal number (e.g., 3.14)
Output Format
Original: [original value]
Doubled: [doubled value]
Input/Output Example
Input: 3.14
Output:
Original: 3.14
Doubled: 6.28
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up