Write a recursive java language program in which user enters a string and an integer and and the program prints the string n times in different lines in output. Input : 2, "Hello!" Output: Hello! Hello!
Added by Micheal R.
Step 1
First, we need to take input from the user for the string and integer values. We can use the Scanner class to take input from the user. Show more…
Show all steps
Your feedback will help us improve your experience
Vaibhav Jain and 95 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write code that takes user input of a String and an integer. The code should print each letter of the String the number of times the user inputted in reverse order. Sample run: Input a String: code Input an integer: 3 eeedddoooccc Note: Written in Java
Willis J.
Programming Language = Python 3. Recursive Lines Write a recursive function that accepts an integer argument, n. The function should display n lines of asterisks on the screen, with the first line showing 1 asterisk, the second line showing 2 asterisks, up to the nth line which shows n asterisks. Sample Output A AA AAA AAAA NOTE: Print A NOT * character as an output for n.
Vandit T.
'1. Write a Java program that prompts the user to enter a line of text and outputs the number of digits, the number of lower case letter and the number of upper case letter in that text.'
Shelayah R.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD