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
uysha [10]
3 years ago
10

The user will input a three digit number

Computers and Technology
1 answer:
zlopas [31]3 years ago
5 0

import java.util.Scanner;

public class U1_L5_Activity_One {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.print("Please enter a two digit number: ");

int x = scan.nextInt();

System.out.println("Here are the digits:");

System.out.println(x/100);

System.out.println((x/10)%10); <em>//Just divide the result by 10 and find the remainder</em>

System.out.println(x%10);  

}

}

<em>//Or, you can do that way:</em>

<em />

import java.util.Scanner;

 

public class U1_L5_Activity_One {

public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.print("Please enter a two digit number: ");

String[] x = scan.nextLine().split(""); <em>//We need it to be a string array, to split the values after "", that is, after each symbol(number)</em>

System.out.println("Here are the digits:");

for(int i = 0; i<x.length; i++) {

          System.out.println(Integer.parseInt(x[i])); <em>//Converting the string into int, as you want</em>

      }  

}

}

You might be interested in
Assign listNodes with all elements with a clasa name prog-lang
ra1l [238]

Using the knowledge in computational language in JAVA it is possible to write a code that Assign listNodes with all elements with a clasa name prog-lang

<h3>Writting in JAVA:</h3>

let listNodes;

 //assigning listNodes with all elements with a class name of 'special-language'

  listNodes = document.getElementsByClassName('special-language');

 //for loop to traverse all node in listNodes and print every element in it with class name special-language

 for (let i = 0; i < listNodes.length; i++) {

     console.log(listNodes[i].innerHTML);

 }

See more about JAVA at brainly.com/question/12975450

#SPJ1

8 0
2 years ago
The font size on presentation slides should not be smaller than _____ -point.
fredd [130]
The font size should not be smaller than 24 points.
3 0
4 years ago
Read 2 more answers
OMGGGGGGGGGGG chloeeeeeeeee plzzzzzzzzzz
tangare [24]

Answer:

huh y did u waste my 6 months ya gone pay for it

4 0
3 years ago
Read 2 more answers
Which of the following are true about cryptocurrency wallets?
dezoksy [38]

Answer:

Looks like it is a multiple choice question

and you didn't give any choice

5 0
3 years ago
The default (preset slide layouts are set up in ____ orientation.
Rama09 [41]
The default is normal view orientation.
3 0
3 years ago
Other questions:
  • Why might you need to convert a file to another file type?
    14·1 answer
  • Text, numbers,graphics, sounds entered into a computer's memory during input operations are referred to as
    11·1 answer
  • ? Assessment
    10·1 answer
  • Stamps offers at-home postage and mailing for a monthly fee. Customers are able to carry a balance on their accounts that allows
    7·1 answer
  • A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large compu
    10·1 answer
  • Write a MASM program to calculate Fibonacci numbers:
    10·1 answer
  • Which three factors should be discussed before planning and building a project?
    15·1 answer
  • The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or
    13·1 answer
  • Which of the following can be used to help find the error
    8·1 answer
  • A man receives a fraudulent email from his bank asking him to confirm his user name and password by going to a particular websit
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!