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
padilas [110]
3 years ago
6

Write a "for loop" that displays a string in the reverse order (DO NOT use the reverse method) 3.

Computers and Technology
1 answer:
elena55 [62]3 years ago
5 0

Following are the code in java to reverse any string without using reverse function.

import java.util.*; // import package

class Main // class

{

public static void main(String args[])  // main class in java

{

String s, r = "";  // string variable

Scanner out = new Scanner(System.in);  // scanner classes to take input

System.out.println("Enter a string to reverse");

s = out.nextLine();  // input string

int l1 = s.length();  // finding length of string

l1=l1-1;

for ( int i = l1 ; i >= 0 ; i-- )  // for loop to reverse any string

{

r = r + s.charAt(i);

}

System.out.println(" The Reverse String is: "+r);  // print reverse string

  }

}

Explanation:

firstly we input any string ,finding the length of that string then after that iterating over the loop by using for loop and last display that reverse string

output

Enter a string to reverse

san ran

The Reverse String is: nar nas

You might be interested in
A design was operating at a maximum clock frequency of f and the clock had no jitter. if the clock started to have jitter of t s
docker41 [41]
A design was operating at a maximum clock frequency of f and the clock had no jitter. if the clock started to have jitter of t secs, what will be the new frequency?
4 0
3 years ago
Which of the following is used to manage the objects in a database?
kirill [66]

The answer is the B: The Navigation Pane

All the objects in a Microsoft Access database are listed in the Navigation Pane. You can view and manage the categories and groups of objects in the Navigation Pane. You can also hide groups, objects, or the entire Navigation Pane. In addition, you can also use the Navigation pane to sort objects, find objects in a database, and add objects to a custom group.  By default, the navigation pane appears when you open a database in Access.


8 0
3 years ago
Suppose x is 1. What is x after x = 1?<br> A. -1<br> B. 0<br> C. 1<br> D. 2<br> E. -2
Dimas [21]

Answer:

its number 10204921094993293959592828358

Explanation:

also 339399393993939399393

8 0
3 years ago
The original U.S. income tax of 1913 was quite simple. The tax was
Svetradugi [14.3K]

Answer:

       Scanner inputObject = new Scanner(System.in);

       System.out.print("Enter your income to calculate the tax: ");

       double income = inputObject.nextDouble();

       double tax = 0;

       if (income <= 50000) {

           tax = income * 0.01;

       }

       else if (income > 50000 && income <= 75000) {

           tax = income * 0.02;

       }

       else if (income > 75000 && income <= 100000) {

           tax = income * 0.03;

       }

       else if (income > 100000 && income <= 250000) {

           tax = income * 0.04;

       }

       else if (income > 250000 && income <= 500000) {

           tax = income * 0.05;

       }

       else if (income >= 500000) {

           tax = income * 0.06;

       }

       System.out.printf("Your tax is: $%.2f", tax);

Explanation:

Here is the Java version of the solution. The user is asked to enter the income and the tax is printed accordingly.

<em>Scanner</em> class is used to take input from user, and the value is stored in <em>income</em> variable. A variable named <em>tax</em> is initialized to store the value of the tax.

Then, if structure is used to check the <em>income</em> value. This <em>income</em> value is checked to decide the amount of the tax will be paid. For example, if the <em>income</em> is $100000, the tax will be calculated as tax = 100000 * 0.03 which is equal to $3000.00. After calculating the <em>tax</em> value, it is printed out using System.out.printf("Your tax is: $%.2f", tax);.

Be aware that the values are <u>double,</u> <u>printf</u> is used to print the value. "<u>%.2f</u>" means print the<em> </em><u>two decimal values</u> in the result.

7 0
3 years ago
7. Which of these statements is true? Agile is a programming language MySQL is a database HTML stands for "Hypertext Markup Link
timurjin [86]

Answer:

None of them is correct, but it seems one of the option has missing words.

The exact definition is, MySQL is a database management system.

Explanation:

Agile is not a programming language, it is a software development methodology.

HTML stands for "Hypertext Markup Language"

Java and JavaScript are different languages.

Actually,  MySQL is a database management system. It is used to deal with the relational databases. It uses SQL (Structured Query Language).

5 0
3 years ago
Other questions:
  • Designing the moving parts of a car—including the engine, drivetrain, steering, and brakes—is done by what type of engineer?
    11·2 answers
  • Signe wants to improve the security of the small business where she serves as a security manager. She determines that the busine
    6·1 answer
  • 1.
    13·1 answer
  • 3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate a
    6·2 answers
  • What is a DreamScape?<br> Explain <br> and give example (if you want)
    10·1 answer
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    8·2 answers
  • Write a C++ program that computes an approximation of pi (the mathematical constant used in many trigonometric and calculus appl
    15·1 answer
  • Javier develops sophisticated fashion websites. He has been asked by the owner of a leading fashion brand to create web content
    13·1 answer
  • Give 3 advantages of using shortcut key, especially in MS Office.
    12·1 answer
  • KELLY Connect
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!