008-003-007
Method Call Chain: Calculation Flow
Easy
Problem Description
method Call Chain: Calculation Flow
In this problem, you will create a program that calls two calculation methods (doubling and adding 10) sequentially from a process method and displays the result of each calculation step to standard output.
Learning Objective: Call other methods from method
Define a process method and call a method that doubles the number and a method that adds 10 in sequence from within it. By displaying the result of each calculation step, you will learn how method call chaining works.
Input
Line 1: Number (integer)
Output
Original: [number]
Doubled: [result1]
Add 10: [result2]
Complete
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