Java Forum |
Forum: |
Subject: |
View: |
|
|
Blue Pelican Site
Login/Edit Account
|
Forgot your password?
|
|
(Page 5 of 5) <Prv
1
2
3
4
5
|
Topic:
Addition and Subtraction Program |
|
ID: tmazing |
Date/Time: 11/28/2013 9:29:14 AM |
Message:
I am trying to create a program that adds and subtracts integers. It needs to be able to recognize leading signs too. Right now, I am able to get it to work unless the leading sign and the integer are separated by a space (for example - 2 - 3). I can get -2 - 3 to work though. I think this is because the whitespace in front of the 2 prevents the computer from recognizing the integer. This is the code, can you please help me solve the problem?
import java.io.*;
import java.util.*;
public class Tester
{
public static void main(String args[])
{
Scanner kb = new Scanner(System.in);
System.out.print("Enter something like 8 + 33 + 1,345 + 137 : ");
String s = kb.nextLine();
Scanner sc = new Scanner(s);
sc.useDelim |
|
Topic:
subclass error |
|
ID: goirish |
Date/Time: 12/31/2013 8:44:17 AM |
Message:
I am trying to compile the project on p. 36-1 & 36-2 in Blue Pelican Java (lesson Inheritance).
I have the BankAccount class compiled correctly, but when I try to compile either the Tester class or the SavingsAccount class I get an error in the class SavingsAccount :
";" expected in the line:
public SavingsAccount(double amount, double rate) //Constructor
This is my first post in this Java Forum so pardon me if I've not given the needed info! I can supply the whole project if that is possible here.
|
|
Topic:
Using StringTokenizer in Military Censor |
|
ID: Javacoding105 |
Date/Time: 01/23/2014 7:55:39 AM |
Message:
I am stuck on the Military Censor project of Lesson 23 StringTokenizer. I would really appreciate if someone would help me with it. This is part of what I have so far.
if(t.hasMoreTokens())//the f is a String array containing all of the "banned" words
{
String c = t.nextToken();
for(int g=0;g<f.length;g++)
{
if(c.equals(f[g]))
{
System.out.println("REJECTED");
}
}
} |
|
Topic:
Java Certification |
|
ID: mapla |
Date/Time: 05/06/2016 9:31:21 PM |
Message:
Hi All,
Iam learning Java and preparing for my Java Certification Exam using these Links..
For Java http://www.javaprepare.com/java-tutorial/
For Java Certification http://www.javaprepare.com/java-certification/
If any one has materials for Java Certification let me know.. Thanks in Advance |
|
Topic:
http://www.javaprepare.com/ |
|
ID: mapla |
Date/Time: 05/21/2016 2:07:06 AM |
Message:
http://www.javaprepare.com/ is very useful for beginners to learn java online..
|
|
Topic:
Programming Resources |
|
ID: mapla |
Date/Time: 06/21/2017 12:38:43 AM |
Message:
Hi all few free tutorial sites for beginners are given below.
C PROGRAMMING
http://learnermode.com/c-tutorial/
Java Applets
http://learnermode.com/java-tutorial/applets/
|
|
|
|
<< New message thread
|
(Page 5 of 5) <<PrevPage
1
2
3
4
5
This Forum automated by software from bluepelicanjava.com
|