Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 10-29-2002, 09:17 PM Please Help
Junior Talker

Posts: 1
Trades: 0
ok.. i have to write this program that does and shows all the steps for long multiplication.. this is what i have for my program.. i just need someone to tell me if i'm completely wrong or ok...

/*
longMulti.java
Task: program to output the product of two integers in "long" multiplication format.
*/

import java.io.*;

public class longMulti {

public static void main (String[] args) throws Exception {
public long longValue () {
return left.num() * right.num();

BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in),1);


int num1;
int num2;
int sum1=0;
int sum2=0;

System.out.println("Enter a two-digit number.");
num1 = Integer.parseInt(keyboard.readLine());

System.out.println("Enter another two-digit number.");
num2 = Integer.parseInt(keyboard.readLine());

if (-100<num1<100 && -100<num2<100) do {
System.out.println(" " + num1);
System.out.println("x" + num2);
System.out.println("__________");
sum1=(right.num2 * right.num1) + (right.num2 * left.num1 * 10)
System.out.println(sum1);
sum2=(left.num2 * 10 * right.num1) + (left.num2 * 10 * left.num1 * 10)
System.out.println(sum2);
System.out.println("__________")
System.out.println(sum1 + sum2);
else System.out.println("Invalid Input");
}
}
}
}

thanks
muskn24 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Please Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.95991 seconds with 12 queries