Two Java programs showing iteration
Not what you're looking for?
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
Purchase this Solution
Solution Summary
This solution provides two simple Java programs that show the concept of iteration.
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 ...
Purchase this Solution
Free BrainMass Quizzes
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Basic Networking Questions
This quiz consists of some basic networking questions.
Javscript Basics
Quiz on basics of javascript programming language.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.
C# variables and classes
This quiz contains questions about C# classes and variables.