1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vovangra [49]
3 years ago
15

Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti

mes the user inputted in reverse order.
Sample run:

Input a String:
code
Input an integer:
3
eeedddoooccc


Note: Write In Java
Thank You...
Computers and Technology
2 answers:
Alexus [3.1K]3 years ago
7 0

import java.util.Scanner;

public class JavaApplication70 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Input a String:");

       String txt = scan.nextLine();

       System.out.println("Input an integer:");

       int num = scan.nextInt();

       String newTxt = "";

       int w = 0;

       for (int i = txt.length()-1; i >= 0; i--){

           char c = txt.charAt(i);

           while (w < num){

               newTxt += c;

               w++;

           }

           w = 0;

       }

       System.out.println(newTxt);

   }

   

}

I hope this helps!

Nesterboy [21]3 years ago
6 0

Answer:

import java.util.*;  

class Main {  

 public static void main(String args[]) {

   Scanner sc= new Scanner(System.in);

   

   System.out.print("Input a String: ");  

   String str = sc.nextLine();  

   

   System.out.print("Input an integer: ");  

   int num = sc.nextInt();  

   

   for(int i=str.length()-1; i>=0; i--) {

       for(int j=0; j<num; j++) {

           System.out.print(str.charAt(i));

       }

   }

         

 }

}

Explanation:

There you go.

You might be interested in
Making phone calls with a public box
AfilCa [17]

Answer:

ja ok it is so eassssy.........................

8 0
3 years ago
A credit card can be a good way to pay when yo can’t afford something for a very long time? True or false
scoray [572]
False. Credit cards usually have high interest rates if you don’t pay them off right away. The only way to benefit from a credit card is if you pay it off by the due date monthly.
7 0
2 years ago
What are the uses of navigation keys​
Zolol [24]
The navigation keys allow you to move the cursor, move around in documents and webpages, and edit text.
3 0
1 year ago
What are the 3 main colors for a computer screen?
zhuklara [117]

Answer:

Red, Green, and Blue.

Explanation:

These colors make up white light

4 0
2 years ago
Read 2 more answers
there are four stage of the product life cycle. during which of these stages do you think is the best time for a company to purc
Alisiya [41]

Maturity Stage – During the maturity stage, the product is established and the aim for the manufacturer is now to maintain the market share they have built up. This is probably the most competitive time for most products and businesses need to invest wisely in any marketing they undertake. They also need to consider any product modifications or improvements to the production process which might give them a competitive advantage. i think this would be the best time for the company to purchase an emerging technology.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a class named grocerylist that represents a list of items to buy from the market. write another class called item that rep
    7·1 answer
  • An undesirable jagged appearance is referred to as
    7·2 answers
  • What nondestructive testing method requires little or no part preparation, is used to detect surface or near-surface defects in
    7·1 answer
  • A Windows application which demands a lot of raw processing power to execute repetitive complex calculations is a good candidate
    9·1 answer
  • Help plzzzz_________ provide a means of organizing and summarizing data A. Reports B. Metadata C. Connectors D. All
    9·1 answer
  • A group of users is unable to connect to the network. When testing several of the PCs and issuing the command ipconfig, the tech
    10·1 answer
  • Select the items that can be measured.
    10·2 answers
  • Develop a stored procedure that will take a state abbreviation as a parameter and list the name of the state, vendor, and total
    9·1 answer
  • Hi Lesiana, After your presentation last week, the manager thinks an in-house solution is the way to go. Although our programmer
    13·1 answer
  • Computer professionals known as software engineers, or Blank______, use the software development life cycle to create software r
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!