 # The program should print the sum of the squares from 1 to 10 and th...

## Question

The program should print the sum of the squares from 1 to 10 and the sum of the cubes from 1 to 10.

In other words, it should calculate the squares from 1 to 10, add them and print them.

And do the same for the cubes from 1 to 10.

You must use the following main method:

public static void main(String[ ] args) {

int totalSquares = sumSquares(10);

System.out.println("The sum of the squares from 1 to 10 is " + totalSquares);

System.out.println();

int totalCubes = sumCubes(10);
System.out.println("The sum of the cubes from 1 to 10 is " + totalCubes);
}

You will have to create method headers for sumSquares and sumCubes that will allow them to be called as specified in the main method.

Note that each method must accept a value from the method call that it will use in performing the calculation.

This value is the is used to determine how many squares and cubes to calculate.

The method headers must also allow the methods to return a value of the correct type.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

public class squaresAndCubes {
public static void main(String[ ] args) {

int totalSquares = sumSquares(10);

System.out.println("The sum of the squares from 1 to 10 is " + totalSquares);

System.out.println();...

By purchasing this solution you'll be able to access the following files:
Solution.java.

\$20.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.