#output not coming the same when clicked void display the second time
82 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @neat epoch! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
i just want it to show "insufficent balance" when i set the credit limit more than my balance amount it shows me the output the first time but does not shows it the second time when clicked the second time
So when you click the second time it show this?
what
the first time
so?
i dont want it to show whole detail if my credit limit is more than my total balance amount i only want issuficent
balance
Oh
Is it a GUI issue or a coding issue, does it work when you just run it? Can you actually calculate the multiplier?
Might be a gui issue
are you the victim?
Uhmmm in the set Credit Limit method, you said you want it to send the "credit... sufficient" when CreditLimit is less than 2.5*balance but instead you do the oppisite
ok
Isn't this suppose to be CreditLimit >= (super.getbalanceAmount()*2.5))?
And you have issue with capital naming
@neat epoch what is the issue, GUI or backend?
Imagine if it is both
could be, he's using light mode
Yeah it's blinding me
relatable
Really wonder why people like light mode
Yeah idk, it's kinda wierd
no the the qustion says credit limit is less than balance amount
So if creditLimit is less than balance amount it send "Credit isuffient" thingy?
He should
i dont know what do you mean by that
Did you write a > b instead of a < b?
no i wrote a < b from the first
send pastebin?
public class CreditCard extends BankCard
{
// six attributes for Credit card
private int CVCnumber;
private double CreditLimit;
private double InterestRate;
private String ExpirationDate;
private int GracePeriod;
private boolean isGranted;
//constructor for CreditCard that accepts eight parameters.
public CreditCard(int cardId, String clientName, String issuerBank, String bankAccount, int balanceAmount, int CVCnumber, double InterestRate, String ExpirationDate)
{
//calling superclass constructor
super(cardId, bankAccount, balanceAmount, issuerBank);
setclientName(clientName);
this.CVCnumber= CVCnumber;
this.InterestRate= InterestRate;
this.ExpirationDate= ExpirationDate;
this.isGranted= false;
}
//accessor method for each attribute
public int getCVCnumber(){
return this.CVCnumber;
}
public double getInterestRate(){
return this.InterestRate;
}
public String getExpirationDate(){
return this.ExpirationDate;
}
public boolean getisGarnted(){
return this.isGranted;
}
public double CreditLimit(){
return this.CreditLimit;
}
public int gracePeriod(){
return this.GracePeriod;
}
// new method for setting the credit limit
public void setCreditLimit(double CreditLimit, int GracePeriod){
if (CreditLimit <=(super.getbalanceAmount()*2.5)) {
this.CreditLimit = CreditLimit;
this.GracePeriod = GracePeriod;
this.isGranted = true;
} else {
System.out.println("Credit Card Balance is isufficient");
}
}
//another method for cancelling the credit card
public void cancelCreditCard(){
this.CreditLimit = 0;
this.CVCnumber = 0;
this.GracePeriod = 0;
this.isGranted = false;
}
//dislay method
public void display(){
//calling super class
if (isGranted) {
super.display();
System.out.println("CVC number:" +CVCnumber);
System.out.println("Interest Rate:" +InterestRate);
System.out.println("Credit Limit:" +CreditLimit);
System.out.println("Grace Period:" +GracePeriod);
}else{
super.display();
System.out.println("CVC number:" +CVCnumber);
System.out.println("Interest Rate:" +InterestRate);
}
}
@dusky field why do you hate me
please help me master stickywilderbeast please i cant solve this difficult case
@neat epoch skill diff https://youtu.be/DmH6YPWhaDY
how it feels to correct someones spelling mistake on the internet
song used: https://youtu.be/TLsLd22mhOA a mashup of Somebody that I used to know and WokeUpLikeThis, you probably searched up Somebody that I used to know trap remix to find the song didnt you?
funny meme big brain galaxy brain video i made in after effects only big brain peo...
@neat epoch
yes
can you solve it?
nah man
you suck
dont be rude i am new to this
he left the server
get the credt card balance of the user
check if its lower than the limit * 2.5
if it is then do the thing
else dont show the error thingy
not difficult
how new are you?
first programming language?
yes
do you know datatypes? booleans, integers, strings, characters, ..?
i know bolean, int and string not characters
characters are strings but only with one character (hence, char)
String helloWorld = "Hello";
char h = 'h';
you see?
ok cool
anyways
if (card.getLimit() >= (card.getBalance() * 2.5)) {
System.out.println("You can spend more money!");
} else {
System.out.println("You can't spend more money!");
}
something like this
@neat epoch
yes
do it already