This is my first time programming. And my first program. My logic will probably be off.. but I can't understand your post Hamenopi. Sorry
Type: Posts; User: caustin89
This is my first time programming. And my first program. My logic will probably be off.. but I can't understand your post Hamenopi. Sorry
import java.util.Scanner;
public class Assignment1 {
public static void main(String[] args) {
int number;
Scanner input = new Scanner (System.in);
System.out.print("Please enter a...
I tried system.exit(0), after the if statement's that determine the number is less or more than 5 digits. But that will end the program even if the user enters 5 digits. So the problem I am having is...
I believe I had. The first part is correct (When a user enters 5 digits).
Now when the user enters an incorrect number (anything other than 5 digits). I want an error message to occur, and solely...
Please enter a 5 digit number: 45632
Thank you.
The individual digits of this number are:
1st Digit: 4
2nd Digit: 5
3rd Digit: 6
4th Digit: 3
5th Digit: 2
3170
I have attached what happens when I run. The picture on the top is what its supposed to look like, when they enter the right amount of digits.
The picture inside the bold box is what...
Sorry, I forgot this code at the end.
System.out.print("\n");
System.out.println("Your number listed as a String: " + myString);
The teacher wanted us to to display the...
Here it is in text:
public static void main(String[] args) {
int number;
Scanner input = new Scanner (System.in);
System.out.print("Please enter a 5 digit number: ");
So I am currently writing my first assignment and have run into problems with my coding. The task was to have someone enter a 5 digit number and in return, I list each number on their respective...