008-003-005

Method Calling Method: Calculation Processing

Easy

Problem Description

method Calling method: Calculation Processing

In this problem, you will create a program that calculates the sum of two integers using calcTotal, calls calcTotal from within calcWithTax to compute the tax-included price, and displays the results to standard output.

Learning Objective: Understand how to call one method from another method

Overview

Create a calcTotal method that calculates the sum and a calcWithTax method that calculates the price including tax. The calcWithTax method calls calcTotal internally.

Specifications

  • calcTotal(int a, int b): returns a + b
  • calcWithTax(int a, int b): multiplies calcTotal result by 1.1 and returns as integer

Input

Two integers are provided

Output Format

Total: 150
With Tax: 165

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