Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
A Day 3 Exercise In Learning Java
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-02-2011, 10:51 PM
Forum Addict
 
Join Date: Feb 2011
Location: USA
Posts: 254
Send a message via MSN to jamesm201
Default A Day 3 Exercise In Learning Java

Today we are going to learn how to make java add up pre set numbers for you.
Using the template that I've shown you before set up the file and declare the int num and int num2 and result. Then give them a value here i gave each a value. Using both num and num2 we are going to give result the multiplicative value of them multiplied

Then after declaring it give it a value, for now use the ones i have provided in my file at the bottom. Using the shown bellow give result the num * num 2 number(don't solve it put what i did bellow)
Then make java execute result to see if it equals what it should equal 14 if not look for mistakes then post on here so i can help you.

int num;
int num2;
int result;

num = 7;
num2 = 2;
result = num * num2;(*for Multiply / for devide - for subtraction + for adding)
System.out.print("num times num2 equals: ");
System.out.println(result);
}
}
Thanks for some edits from rsgold4u
__________________

Last edited by jamesm201 : 03-02-2011 at 11:24 PM.
Reply With Quote
  #2  
Old 03-02-2011, 11:01 PM
Forum Addict
BANNED
 
Join Date: Nov 2007
Posts: 328
Send a message via MSN to rsgold4u
Default Re: A Day 3 Exercise In Learning Java

if you going to post java code to help people at least post it correctly.

All of the "system.out.print" MUST be "System.out.print"

If you are going to add a commend you must have /**/ or //

If you are going to display numbers in a print statement you must do this.

system.out.print("num times num2 equals: ");

MUST BE

System.out.print(num + "times " + num2 + " equals: ");
Reply With Quote
  #3  
Old 03-02-2011, 11:25 PM
Forum Addict
 
Join Date: Feb 2011
Location: USA
Posts: 254
Send a message via MSN to jamesm201
Default Re: A Day 3 Exercise In Learning Java

Your incorrect its optional for putting it all in one system.out.print statement for the sake of them learning it and memorizing it i put it as split. Thanks though that is also another way.
Thanks its been a long day and i was sick thanks it would suck to see someone mess up from a little error like that
__________________

Last edited by jamesm201 : 03-02-2011 at 11:29 PM.
Reply With Quote
  #4  
Old 03-05-2011, 02:50 AM
Apprentice
 
Join Date: Feb 2011
Posts: 866
Default Re: A Day 3 Exercise In Learning Java

you should use
Code:
 Code
tags
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

All times are GMT +1. The time now is 08:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1