0% found this document useful (0 votes)
4 views1 page

Java Program for Number Conversion

The document is a Java program that prompts the user to enter a number and attempts to convert it into its corresponding English word representation. It contains a loop to determine the length of the number and uses conditional statements to assign the appropriate word to the variable 'numberString'. However, the code has several syntax errors and logical issues that would prevent it from compiling and functioning correctly.

Uploaded by

KarimWohler
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Java Program for Number Conversion

The document is a Java program that prompts the user to enter a number and attempts to convert it into its corresponding English word representation. It contains a loop to determine the length of the number and uses conditional statements to assign the appropriate word to the variable 'numberString'. However, the code has several syntax errors and logical issues that would prevent it from compiling and functioning correctly.

Uploaded by

KarimWohler
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import [Link].

Scanner;
public class numberingSystem{
public static void main(String [] args){
Scanner reader = new Scanner([Link]);
[Link]("Enter a Number: ");
number = [Link]();
int length = 100;
int counter = 0;
String numberString;
for(int i = 0; i < length; i++){
if(length != 0){
length = (int)((number) / 100);
counter++;
}
if(counter = 0){
numberString = "Zero";
}
if(counter = 1){
if((int)(number) = 1){
numberString = "One";
}
if((int)(number) = 2){
numberString = "Two";
}
if((int)(number) = 3){
numberString = "Three";
}
if((int)(number) = 4){
numberString = "Four";
}
if((int)(number) = 5){
numberString = "Five";
}
if((int)(number) = 6){
numberString = "Six";
}
if((int)(number) = 7){
numberString = "Seven";
}
if((int)(number) = 8){
numberString = "Eight";
}
if((int)(number) = 9){
numberString = "Nine";
}
}

You might also like