« first day (1194 days earlier)      last day (2281 days later) » 

9:49 AM
hellow, and morning :3
 
9:59 AM
@nef Ohayou
 
10:29 AM
hi everybody
I have a appbar that scrolled when my list scrolled.I scroll list untill appbar hide and then press back now appbar is hide but I need it be visible
 
11:19 AM
@TheLittleNaruto ohayou :3
 
Hi
 
11:58 AM
hey
anyone here?
 
yes
 
okay
 
Hello again
 
hey there
 
Just testing the formatting thing again, ive not used stack overflows chat rooms before
   public static String promptUserForCampType(){

      String campType;

      do{

         campType = JOptionPane.showInputDialog("Enter the type of campaign you have (Non Profit or For Profit)");
         if((!campType.equalsIgnoreCase("Non Profit") && (!campType.equalsIgnoreCase("For Profit")))){

            JOptionPane.showMessageDialog(null, "Error: Please enter either Non Profit or For Profit for your campaign type.");
         }

      }while(!campType.equalsIgnoreCase("Non Profit") && (!campType.equalsIgnoreCase("For Profit")));
 
12:00 PM
same lol
 
ok seems to be ok
 
use hastebin.com or any bin site
 
   public void setDonationTotal(double donationAmount){
      donationTotal+=donationAmount;
    }
 
should i get rid of that line
 
posted on February 14, 2016

New Cyanide and Happiness Comic

 
12:01 PM
or, keep that line
 
@Hello what line?
 
As i said im not familar with java, but i think you need

this.donationTotal += donationAmount
Since you want to add it to the class variable
also, you said earlier that you can keep adding to the total. That function is why. There is no check
 
oh
neferpitou can I explain what im trying to do?
trying to increment a total
 
I think miller did explain the right thing..
sorry cant really help this time
 
Id also recommend changing the function name to "addDonationTotal", rather than "setDonationTotal"
Set means, your setting it, not adding/subtracting from it. Just a bit confusing thats all
 
12:05 PM
my instructor would take pts off
he wants us to make it a habit
and this is our first assignment.
 
Make what a habit?
Naming stuff "set"?
 
using getX and setY
just because we are learning mutators and acessors
 
ah ok, well, do what you need to get points
 
yup
when I add the this.donationTotal
it doesnt change anything
i can still enter unlimited amounts
of donations
 
Have you put the check in ?
 
12:08 PM
what would I put?
 
Think about it. At what point do you want the donations to stop being added?
 
if greater than campgoal
 
perfect, so convert that to code
only add to the donation amount if the current donationTotal is less than the campaignGoal
 
yup
 
Do you see why we would need that?
Also coding when your very tired is very difficult :P
 
12:10 PM
to make it stop
i have been awake for >24 hrs
:(
 
is there a deadline approaching soon
 
I had to go to the hospital and got sidetracked
this week..
so i started this assignment later than usual
 
How close are you to finishing?
 
its due at 11:59 PM tonight
other than the math stuff = done
thats why i dont want to sleep until i fix this
i wanna earn it
earn my sleep
 
Can you send me the updated code in a pastebin? or a gist like before so I can see what you've changed
 
12:12 PM
okay
do you have an IDE?
do you see this method puu.sh/n7vM9/236e98bc58.png
its kinda suspect to me..
im adding to total in there as well
only if the amount is greater than 0 and the amount is less than or equal to the goal
 
erm, i might need to install one
 
haha its ok
 
why a set donation amount?
and also a
setDonationTotal
 
ill just keep the setDonationTotal
 
I dont think the class itself needs to hold a donation amount
all it should need is the total, and the goal right?
 
12:17 PM
this assignment doesnt care about printing individual donations, just totals
 
What IDE do you use?
 
jGrasp
 
Hmm ill install one
 
oh cool D:
:D
 
I can have a play with Java then
 
12:20 PM
heres my code for setDonationTotal
public void setDonationTotal(double donationAmount){
if(donationAmount<campGoal){
this.donationTotal+=donationAmount;
}
}
I think I figured out another issue
my conditional logic for gathering donations
 
What are the requirements again?

A campaign should stop receiving donations once its total has been reached?
 
ok gimme a few mins, need to finish something myself first :P Then ill have a look over it
 
oh np
lol:D
 
@the where r yah?
@minato and u too
:3
 
12:26 PM
okay so i just did the following
the goal was 10,000
i enter a donation of 10000
the report comes up and says i gave the campaign 0 dollars lol
 
donationAmount<campGoal
=<
 
now that i did that, it never leaves the loop either lol
This is so frustrating
 
you can do it
trust yourself
:3
 
I have worked on this for 24 hrs ._.
 
you should sleep
 
12:29 PM
im so sleepy but i cant sleep til i fix it
 
its unproductive
 
yaeh true
im stubborn
 
You brain needs air
 
My brain reminds me of the population density of iceland
 
your immune system becomes weak
her last tweet
 
12:31 PM
;-;
 
Ok i have an ide
 
yay
!!!
i feel like im dead
lol
this screen ive stared at too long
 
ffs im working today
and my boss is hungover, so getting information i need is a pain
Erm, i cant see any other way of really doing this
actually,
i should be able to make a project and put your code in right?
 
yep
new java file
 
ok pastebin your latest
or gist
or whatever
 
 
@neferpitou I was sleeping. :-)
 
ok cool got it running
No idea how to Java though, so gimme a few mins
 
ah cool
 
1:02 PM
im so sleepy...omg
 
Ah i see
you create the 2nd campaign after all the of user inputs are done
 
o
i think thats ok
right?
 
Doesn't matter, its fine
 
the proble m i think is my redundant donationTotal code in both classes
 
What i would have done though is have a campaign ask for user inputs
campaign2.getDonations() or something
but i see why you did it your way, and its fine, ignore me. Lets get to the issue
 
1:06 PM
ok
 
Ok i see why your getting 0.0 for your total donations
 
oh
 
public static double promptUserForCampDonation(double campGoal){
}
that function
 
The total isnt calculating
 
Correct
 
1:12 PM
Aha
 
And since your calculating outside of that campaign class, does it even need those add functions?
 
I don't think so
 
Your returning a pre calculated value, and assigning it to a campaign instance
 
ah thats why its 0.0
so what do I need to do?
 
We dont need donation amount in campaign
So all we need, is the total amount of donations
and the campaign goal
 
1:19 PM
yup
the print at the end doesnt care about the individual donations
 
Yep, so get rid of anything to do with individual donations in the class
 
what method do i want to keep?
calculateTotal?
sec trying someting
 
Why would you want calculate total?
 
im just adding donationAmount to itself
 
promptUserForCampDonation(campGoal);

Will return the total
 
1:24 PM
i can add to total in there
and return total
 
Correct, thats what ive done to your code
Would you like to see, or would you like to try first
 
oh can I see? i just fixed mine i want to see if its the same
ill make a new java file to compare
you just add an else statement after the if
right?
 
in that function?
 
yeah
 
promptUserForCampDonation(campGoal);
 
1:28 PM
can you send the code?
maybe my way was wrong
haha
 
Yes you could do that
Which is what I have done. I also got rid of your inner while loop. Was that necessary?
 
well the user needs to determine when they want to leave, i think the reason i had it there was for that, but forgot to put the conditional logic for it
 
I dont think you need the inner while loop
All we need to check for is that the donation total has been met
 
thats true
 
the try/catch stuff will display any message needed
 
1:34 PM
im so tired..
wow
ive never been awake this long lol
thanks for your help btw
 
Here, take a read over my changes to the function
Also formatted it since unformatted code is harder to read :)
then, with that total amount that is returned...
use it in the new campaign
 
Can someone please look into this question stackoverflow.com/questions/35386387/…
 
aw it still says 0.0 dollars collected
;(
this time it actually ends when you get to the goal
but the total never increments for me
 
Are you assigning the total to the campaign correctly?
 
how?
 
1:39 PM
In the constructor
 
sorry
where?
 
new Campaign(campName, campType, campGoal, donationTotal);
 
im so tired
 
All a campaign needs remember, is its name, type, goal and total donations
 
okay well i have it like that, still doestn work
 
1:41 PM
So you may need to edit your campaign constructor, which is this..
Campaign(String campName, String campType, double campGoal, double donationAmount, double donationTotal) {
this.campName = campName;
this.campType = campType;
this.campGoal = campGoal;
this.donationAmount = donationAmount;
this.donationTotal = donationTotal;
}
 
I just removed the double donationAmount
from the argument list
 
Yep good
and get rid of the assignment
this.donationAmount = donationAmount;
 
for donationAmount?
 
we dont need that anymore
 
okay I did it
should I get rid of the private variable
above?
or keep it
 
1:43 PM
Ok so your new Campaign(); line is probably broken now
errrr
Yes you can do
 
its not broken
 
oh ok, something Java does then i guess
Right so now, you should be assigning the correct value to the campaign
for it to display in the results box
 
ok
let me try
I will tell you what I enter
i did the following
entered 20000 once
and it brings this up
 
Hmmmm
Send me what you have so far and ill take a look
 
1:49 PM
Oh i see it
double donationAmount = promptUserForCampDonation(campGoal);
 
whats wrong with it O:
 
What are you giving the campaign?
 
Hmm
 
Campaign campaign2 = new Campaign(campName, campType, campGoal, donationTotal);
double donationAmount = promptUserForCampDonation(campGoal);
 
im confused, whats wrong with it?
 
1:51 PM
Your assigning the total donation amount to donationAmount
and your giving the campaign, donationTotal
which is 0
double donationTotal=0.0;
So you need to change

double donationAmount = promptUserForCampDonation(campGoal);

to

donationTotal = promptUserForCampDonation(campGoal);
 
oh
 
See it now? :P
 
Holy shit
it works!
 
:)
 
yaaaaaaaaaaay
I can finally sleep
lol
 
1:53 PM
Id take a fresh look at it after sleeping too
Should make more sense
 
yeah, true
the thing I need to implement is the ability for the user to leave the loop
when entering their donations
 
Oh so they stop entering donations?
 
they are allowed to
yep
 
Ok erm
not sure if you can make another button on that popup or not
 
I think what I will do is
 
1:55 PM
that or if they enter 0
exit out of the loop
or even a blank field
 
if they enter -1, set a flag variable off
and exit loop
is that ok?
 
yep that would work
You wouldnt even need a flag variable
 
if donationAmount=-1
?
 
thats an assignment
if donationAmount == -1
dont forget the double =
 
ohh yea
 
1:56 PM
Ive messed up doing that too many times :P
 
==
i had those issues on my exams
lol
 
really annoying bugs can come from that
 
yeah, i always screw it up lol
 
And did you know you can exit the loop
 
but im geting better :D
 
1:57 PM
without a flag variable
 
No
 
When you want to exit out of the loop
use
 
negation?
 
break;
 
i cannot use break :( they dont let us
 
1:58 PM
oh what really
 
too ez
 
thats annoying/stupid
 
my school is so annoying like that haha
yep hahaha
 
I guess you will have to do a flag variable then
 
okay sounds good, let me try to implement it
 

« first day (1194 days earlier)      last day (2281 days later) »