answer.
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
Llana [10]
2 years ago
12

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. I believe it's supposed to use nested loops, but I can only get it to repeat the whole word backwards x times.
ex.
Input a String:
code
Input an integer:
3
eeedddoooccc
Computers and Technology
1 answer:
il63 [147K]2 years ago
8 0

import java.util.*;

public class myClass {

public static void main(String args[]) {

Scanner scan = new Scanner(System.in);

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

String str = scan.nextLine();

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

int num = scan.nextInt();

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

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

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

}

}

}

}

You might be interested in
Given an n-element array X, algorithm D calls algorithm E on each element X[i]. Algorithm E runs in O(i) time when it is called
krek1111 [17]

Answer:

O(n^2)

Explanation:

The number of elements in the array X is proportional to the algorithm E runs time:

For one element (i=1) -> O(1)

For two elements (i=2) -> O(2)

.

.

.

For n elements (i=n) -> O(n)

If the array has n elements the algorithm D will call the algorithm E n times, so we have a maximum time of n times n, therefore the worst-case running time of D is O(n^2)  

5 0
2 years ago
Use the Manufacturing database from "Excel Databases.xls" on Blackboard. Use Excel to develop a multiple regression model to pre
Dennis_Churaev [7]

Answer:

52.64

Explanation:

Multiple Regression:

Multiple regression generally explains the relationship between multiple independent or predictor variables and one dependent or criterion variable.

Please kindly check attachment for the step by step solution of the given problem.

6 0
2 years ago
Tyler wants to upgrade his very old operating system to the latest mac or microsoft operating system, but he cannot seem to inst
nordsb [41]
Every program has minimum system requirement, so at least His CPU is not good, or the amount of his RAM is too short to run the new version of OS.
6 0
2 years ago
Terry came into work and turned on his computer. During the boot process, the computer shut down. When he tried again, the compu
Svetllana [295]

Answer:

SATA Cable

Explanation:

SATA (Serial Advanced Technology Attachment) Cable is a connection made between Computer hard drives and the motherboard. When a computer gives an error on startup that OS not found, there's a possibility that the drive containing the OS is not well connected to the motherboard. Making sure it is well connected to the motherboard will possibly fix the issue.

6 0
2 years ago
To erase an entire entry in a cell and then reenter the data from the beginning, press the ____ key. alt esc ctrl tab
Daniel [21]
To erase an entry in a cell and then reenter the data from the beginning press the esc key. Hope that helps!
8 0
2 years ago
Other questions:
  • Your computer has gradually slowed down. What's the most likely reason?
    8·1 answer
  • The elements in a string type array will be initialized to ____.?
    10·1 answer
  • Exercise 6.3 consider memory storage of a 32-bit word stored at memory word 42 in a byte-addressable memory. (a) what is the byt
    14·1 answer
  • The ________ program displays graphics and loading screens during the boot process.
    8·1 answer
  • Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
    10·1 answer
  • _____ is a markup language designed to transport and store data on the Web. Group of answer choices Standard Generalized Markup
    13·1 answer
  • What text results in variable white space (blank) texts results In even white space
    9·1 answer
  • reAay ouyay aay hizway ithway igPay atin?Lay? (Translated: "Are you a whiz with Pig Latin?") Write a program that converts an En
    6·1 answer
  • Which of the following is true about sorting functions?
    14·1 answer
  • Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!