Question
1.How do I create a method with the following specifications: name : CalculateSumOfCubes arguments : none return value : int representing the sum of the
1.How do I create a method with the following specifications:
name: CalculateSumOfCubes
arguments: none
return value: int representing the sum of the cubes of its input
displays: the user prompts but NOT the sum of the cubes
tasks:
prompt the user for the number of inputs that she will be working with
read in the user input
Prompts the user for their input
Accumulates the sum of the cubes input
Repeat the above two steps are many times as required
Returns the final sum
In your main when the user enters 5 in response to the menu choices, you will invoke this method and display the resulting value.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started