I have a midterm coming up tomorrow night, and it's basically us reading a set of codes and seeing where the errors are and what set of codes are needed to make the program compile succesfully.
...
Type: Posts; User: alex067
I have a midterm coming up tomorrow night, and it's basically us reading a set of codes and seeing where the errors are and what set of codes are needed to make the program compile succesfully.
...
So if I wanted tcode 3 to terminate the program, wouldn't my while statement be:
}while (tcode > 0 || tcode < 3);
this statement means, if tcode is greater than 0, and tcode is less than 3,...
So if I wanted tcode 3 to terminate the program, wouldn't my while statement be:
}while (tcode > 0 || tcode < 3);
this statement means, if tcode is greater than 0, and tcode is less than 3,...
Values of tcode that would end the loop would just be 3
Values for tcode to stay in the loop would be 1,2
So I would do, }while (tcode > 0 || tcode < 3) ? So for every tcode greater than 0 (to...
So how should the while statement be constructed in order to make tcode = 3 to input the last of the transaction and end the program?
import javax.swing.JOptionPane;
import java.text.DecimalFormat;
public class Assignment1
{
public static CheckingAccount info;
Unfortunately my Java instructor's teaching method is to just show us various programs and stat what each line does.
I don't find this teaching method very helpful as I just completely forget...
No need to act cocky, I've done exactly what you've said and it didn't print anything out.
You told me to put those 2 statements before message =
}while(tcode < 0 || tcode > 2);
...
I printed those 2 new statements right after the last message but nothing printed out apart from the error I previously posted.
I put those 2 statements right before the }while message right?
I printed the 2 system.out.println for formatter and info and the runtime error states:
Exception in thread "main" java.lang.NullPointerException
at...
Well the runtime errors stats that it's at line 174 and 72.
line 174 is the last message string in the if else statement in the main method, where
else
{
message = "Transaction: Check in...
So in order to fix it, I would remove the null in the line the error stated?
Sup guys, I have 2 questions.
1) I am getting a compiler error which states this exactly:
run:
Exception in thread "main" java.lang.NullPointerException
at...
My updated code for the input is:
do
{
int tcode;
tcode = getTransCode();
Sorry for being rather vague.
The instructions are:
Write a class with methods to help you balance your checking account(an object class-main method is not in this class). The CheckingAccount...
I have an assignment which consists of obtaining a balance from the user, then depending on the type of transaction, return the results of their balance. It's a transaction program.
My current...
The messiness is due to the fact that my instructor provides us with a sample code, thus those helper methods were provided but not filled out.
import javax.swing.JOptionPane;
public class Assignment1
{
public static CheckingAccount info;
That's all the compiler error gave me I'm afraid.
My main question is regarding the main procedural step and how I should proceed from where I left off, as I'm a bit lost on what to do at the...
When I compile the error states:
main at exception breakpoint java.lang.RuntimeException
Assignment1.main:30
It just says identifer expected, there's nothing more.
The error can be seen as I've pasted right under public class assignment1
The only error that came up was identifer expected, nothing else. I am running Netbeans IDE.
Sup folks, I have a rather unorganized homework assignment which consists of creating a program which stores the users initial balances and maintains their checking account.
The assignment...
I read the links you gave me, and I'm very sorry in advance for the multiple threads.
I've extensively read the links, but I'm just confused on the instance methods.
...
Hey guys. I'm having trouble on a beginners java assignment, and not touching Java in two years has not helped at all.
My question is relatively easy and is for beginners;
I am to create a...