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]
2 years ago
10

The user will input a three digit number

Computers and Technology
1 answer:
zlopas [31]2 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
What was the first Apple computer, and who was it designed by?
DerKrebs [107]

Answer: The first Apple Computer was Apple 1. The designer was Steve Wozniak.

Explanation: Steve Wozniak and Steve Jobs both created Apple 1. Mainly, Steve Wozniak designed it.

Hope this helps!

7 0
3 years ago
Read 2 more answers
When creating a presentation in Libre Office Impress, where does the editing of slides take place?
kondor19780726 [428]
The Canterbury Tales, written towards the end of the fourteenth century by Geoffrey Chaucer, is considered an estates satire because it effectively criticizes, even to the point of parody, the main social classes of the time. These classes were referred to as the three estates, the church, the nobility, and the peasantry, which for a long time represented the majority of the population.
4 0
3 years ago
Which of the following statements about the use of desktop publishing software is true? A. There's no visible difference between
xxTIMURxx [149]
The correct answer to the question is option D.

A good number of desktop publishers would rather create the text portion of their documents using a word processing program, and then import the text into a desktop publishing file. Thankfully, w<span>ord processing programs are compatible with desktop publishing and other software programs.</span>
8 0
3 years ago
Using the ____ browsing mode offered by some browsers can prevent personal information from being left on a public computer.
seraphim [82]
The answer is incognito browsing
4 0
3 years ago
Which shot is not the best for a widescreen image
balu736 [363]
Portrait landscape is better for wide images
6 0
3 years ago
Other questions:
  • What is the final step used when designing an algorithm?
    14·1 answer
  • Elvis has asked Bonnie out on a date to a baseball game. Elvis is a friend of Bonnie's classmate Ginger and she has met him a fe
    5·2 answers
  • Write a (java) program with a class called Sum1, using a while loop to add 10 numbers entered from the key-board.
    5·1 answer
  • Why is drafting important in every industry
    6·1 answer
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • Help !!!!!
    9·1 answer
  • Amy just added a 462 meter run of fiber optic cable to the network what should she do next?
    10·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • Which of the following access control techniques allows the user to feel empowered and able to change security attributes?
    5·1 answer
  • A technician has been asked to upgrade a processor and needs to do some research. The computer is just a couple of years old. Wh
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!