Explore BrainMass
Share

Explore BrainMass

    Two Java programs showing iteration

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    1. Write a program that ask the user for starting value and an ending value and then writes all the integers (inclusive) between those two values

    Sample output:
    Enter Start:
    5
    Enter End:
    9

    5 6 7 8 9

    2. Write a program that ask the user to enter a word. The program will then repeat word for as many time as it has characters:

    Sample output:

    Enter a word:
    Hello

    Hello
    Hello
    Hello
    Hello
    Hello

    © BrainMass Inc. brainmass.com October 10, 2019, 12:01 am ad1c9bdddf
    https://brainmass.com/computer-science/java/two-java-programs-showing-iteration-275832

    Solution Preview

    This posting was asking for two different Java problems. Both of the problems demonstrate how to use a for loop.

    The first problem asks the user to enter two integer values and then prints all of the integers between them. Asking for ...

    Solution Summary

    This solution provides two simple Java programs that show the concept of iteration.

    $2.19