Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 7
There are 1 users currently browsing forums.
JavaScript Coding JavaScript allows rich, browser-based web-applications with interactivity and complex visual effects. For discussion on JavaScript, use this forum.

Reply
  #1  
Old 04-13-2009
Child
 
Join Date: Oct 2008
Location: Canada
Posts: 79
Rep Power: 2
cantidosan is on a distinguished road
no print statment works

Code:
import java.util.Scanner;
class KeepingMoreKidsQuiet 	
{
	public static void main(String args[]) 
	{
		Scanner myScanner = new Scanner(System.in);
		int gumballs;
		int kids;
		int gumballsPerKid;
		System.out.print(“How many gumballs? How many  kid");                                     
		gumballs = myScanner.nextInt();
		kids = myScanner.nextInt();
		gumballsPerKid = gumballs / kids;
		System.out.print(“Each kid gets “);
		System.out.print(gumballsPerKid);
		System.out.println(“ gumballs.”);
	}
}
when i try to build the project i get errors. I am new to this language . My print statments just dont seem to work. I am sure its a simple solution but i have no clue .
Any help would gladly be appreciated,thanks
Reply With Quote
  #2  
Old 04-14-2009
hot_cakes's Avatar
Moderat0r!!1
 
Join Date: Aug 2005
Location: Bristol, UK
Age: 27
Posts: 2,939
Rep Power: 7
hot_cakes will become famous soon enough
Re: no print statment works

<soapbox>
Always give the specific errors. You're more likely to get help if you provide all the information. You wouldn't go to the doctor and withhold your symptoms, would you?
</soapbox>

At a quick glance, it looks like you might be writing your code in a word processor, rather than a text editor. That would at least explain why you have a mixture of different kinds of quote characters in your code.

Edd
Reply With Quote
  #3  
Old 04-14-2009
gorda001's Avatar
This user is deprecated.
 
Join Date: Jun 2005
Location: <0x79a3f6>
Posts: 5,064
Rep Power: 10
gorda001 is on a distinguished road
Re: no print statment works

Quote:
cantidosan originally posted: View Post
Code:
import java.util.Scanner;
class KeepingMoreKidsQuiet 	
{
	public static void main(String args[]) 
	{
		Scanner myScanner = new Scanner(System.in);
		int gumballs;
		int kids;
		int gumballsPerKid;
		System.out.print(“How many gumballs? How many  kid");                                     
		gumballs = myScanner.nextInt();
		kids = myScanner.nextInt();
		gumballsPerKid = gumballs / kids;
		System.out.print(“Each kid gets “);
		System.out.print(gumballsPerKid);
		System.out.println(“ gumballs.”);
	}
}
when i try to build the project i get errors. I am new to this language . My print statments just dont seem to work. I am sure its a simple solution but i have no clue .
Any help would gladly be appreciated,thanks
You're not writing your code in MS Word are you?
Reply With Quote
  #4  
Old 04-14-2009
Child
 
Join Date: Oct 2008
Location: Canada
Posts: 79
Rep Power: 2
cantidosan is on a distinguished road
Re: no print statment works

no i am not writing it in word i wrote it using jcreator . could you explain what you mean by different quote charachters?

Last edited by cantidosan; 04-14-2009 at 05:26 PM. Reason: poor grammar
Reply With Quote
  #5  
Old 04-14-2009
gorda001's Avatar
This user is deprecated.
 
Join Date: Jun 2005
Location: <0x79a3f6>
Posts: 5,064
Rep Power: 10
gorda001 is on a distinguished road
Re: no print statment works

“ isn't an ASCII quote character.

“ vs "


Do you see the difference?
Reply With Quote
  #6  
Old 04-14-2009
Child
 
Join Date: Oct 2008
Location: Canada
Posts: 79
Rep Power: 2
cantidosan is on a distinguished road
Re: no print statment works

....wow..... i cant believe it, thank you
Reply With Quote
  #7  
Old 04-29-2009
New Born
 
Join Date: Apr 2009
Posts: 1
Rep Power: 0
Aadil is on a distinguished road
Re: no print statment works

i was facing the same problem thank u so much for helping n telling the solution...

Cards & Games Shopping Directory | Body Arts Trade Suppliers Directory | Visual Arts Business Directory | Holidays Business Directory
Reply With Quote


Reply


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

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in a python program..need help! Kachulach General Programming 5 04-15-2009 05:47 AM
[Reviews?] Written application Reaper General Programming 11 07-13-2007 07:32 PM
Instant Hacking (An Introduction to Python) Part 1 jacotyco Articles, Tutorials, and Guides 3 01-30-2007 11:35 AM
help with my code plz tony1 Visual Basic Programming 5 01-25-2007 09:35 AM
Print in "Visual Studio 2005" NuWeb Visual Basic Programming 2 06-05-2006 01:23 PM