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

4:00 PM
yea so the fee is calculated properly
but idk what to put
for the call
 
You have a set Donation total function
public void setDonationTotal(double donationAmount) {
if (this.donationTotal <= campGoal) {
this.donationTotal += donationAmount;
}
}
Lets use that
But we need to change it
So we want to calculate the fee
then set the total donation to this new value
so


public void setDonationTotal(double donationAmount) {
if (this.donationTotal <= campGoal) {
this.donationTotal += donationAmount;
}
}
would become


public void setDonationTotal(double donationAmount) {
this.donationTotal = donationAmount
}
 
oh
yeah that makes sense
public double calculateFee(String campType, double donationTotal){
      if(campType.equalsIgnoreCase("For Profit")){
         return donationTotal+= (donationAmount - (donationAmount*0.05));
      }else if(campType.equalsIgnoreCase("Non Profit")){
         return donationTotal;
      }else{
         return donationTotal;
    }
   }
  }
this line is still messed up
i should change the 3rd line
return donationTotal=donationTotal*0.95;
 
Yep
 
kk
now, how do I get this method to communicate
with the other class
 
?
I dont think you need to do that
just use the function
double donationMinusFee = campaign2.calculateFee(campType, donationTotal);
campaign2.setDonationTotal(donationMinusFee);
  printReport(campaign1, campaign2);
 
4:08 PM
public class Donations {

   public static void main(String[] args){


      Campaign campaign1 = new Campaign("IT Student Scholarship Fund", "Non Profit", 15000.0, 6855.0);


      String campName = promptUserForCampName();
      String campType = promptUserForCampType();
      double campGoal = promptUserForCampGoal();
      double donationTotal = promptUserForCampDonation(campGoal);

      Campaign campaign2 = new Campaign(campName, campType, campGoal, donationTotal);
      //calculateTotal(donationTotal,donationAmount);
put those lines after the campaign2 constructor?
i mean it makes sense
 
correct, cant use its functions without instantiating the object first
 
kk
 
Unless its static, but thats for another time :P
 
We just started that
haha
The math didnt work
O_O
wait..
sec. lol
Now it works
 
You guys are studying or working somewhere ?
 
4:11 PM
Nope im just a newbie who met Miller on here (he is Jesus and helped me out)
 
ohh good for you.
So you guys completed the task ?
 
Yep
mission accomplished
you could say
and it all makes sense for once
 
Cool \o/
 
which is good considering my midterm is in 2 weeks lol
yeah im happy :D
and now I have the rest of the day to sleep
 
Well done guys!
 
4:14 PM
we did it
high five @Miller
 
You guys keep the room chatty on Sunday.
:)
 
haha
:)
 
Oh cool its working now?
Clean up stuff that isnt used too
 
Yep its working now
 
That line of code I gave you
could also do
campaign2.setDonationTotal(campaign2.calculateFee(campType, donationTotal));
all in a single line
 
4:16 PM
so what you did was you made a variable that receives the result from calculateFee and then you pass it as an argument in the other method setDonationTotal
 
Do you see how that would work?
 
yeah, you are calling a method within a method right?
 
Correct, although I didnt really create a variable
 
donationMinusFee I thought haha
 
calculateFee just returns a double
which gets passed into setDonationTotal()
 
4:17 PM
thats so smart
I love programming
lol
 
donationMinusFee was part of the previous example
 
yeah well that was a good idea
 
I would have done it that single liner way, but i knew your new so i kept it simple so you could understand
 
in the future I can do that though
 
Annoyed how they wont let you use simple "breaks" in while loops
 
4:18 PM
Good to know
yep, its rly annoying
 
In real world, you want things as simple as possible
a break is fine and is easy to read
But i had to do annoying shit like that too at Uni
 
hahaha
 
Oh well, i messed with some Java today, which was cool
 
:D
This is my 2nd semester
I'm going to George Mason University for Applied IT
 
Reason i could just "do it" was that i know parts of C++
I did C++ for like 3 years but ive forgotten most of it
 
4:19 PM
I am gonna concentrate in network security but we are required to take some java
 
and wasnt that good at C++
 
nice, I want to learn C++
 
c++ is a tough language
Java is somewhat similar to C++ with its syntax and stuff
 
is there a reason for wanting ot use it over java?
 
So easy to change and understand your program
 
4:20 PM
that you know of?
 
errrr
Android only uses Java right?
 
I think
 
I dont think you could code an android application in C++ unless you use a framework
 
what is a framework?
 
like QT
 
4:21 PM
@Miller right
 
Can write code in C++, and itll compile C++ for several devices
So i could get an app written in C++, on both IOS and Android
 
That seems like it would save a lot of time
 
... I think anyway
 
doesnt someone have to program the framework?
 
yup!
 
4:22 PM
that has to be the most complicated part!
lol
 
Yeah dont worry about that for now. I've no idea how it works and it would take me ages to get a basic understanding of the framework
But as a developer, you dont really need to worry about that. Learning the how to use the framework itself is what you need to concentrate on
 
good point
 
I use AngularJS, quite a complicated framework. I look into the source code every now and again. Lots of complex things in there though
You can do some cool stuff with javascript though

This might run like crap but try it
 
A lot mroe complex than trying to calculate a 5% fee on a donation to a campaign about Paper
 
First time i tried to make a game with javascript and the html5 canvas

http://jackmiller.io/pong/
Oh it has scrollbars now, thats broken
:P
 
4:26 PM
this looks so fun
haha
 
Are you learning javascript?
 
not really, but i was curious how similar java and javascript are
 
ah, well you can play with the code to that pong game if your curious
 
that would be awesome
 
https://github.com/jackmiller334/javascript-pong

Just open up index.html and it should come up in your browser
The codes not like.. good though
so dont learn any bad habits from it! :P
 
4:29 PM
haha its interesting :D
 
Anyway I need to go and concentrate for abit on some work
 
Okay
I'll be around, nice to meet you
 
Just trying to think how you might contact me in the future
err
 
You are a great person :D
 
I dont really come on here
I ended up on the javascript chat and i cant remember why
 
4:30 PM
lol
:p
 
What is everyone else doing here?
Damn all of the Java rooms are dead on stack overflow
Right
Bye! :)
Ill come back to this channel occasionally
 
Hi, anyone in android?
 
5:08 PM
me, but i'm very beginner
 
5:26 PM
1
Q: Run python script through php on browser

driftking9987I have a simple python script. anubhaw.py #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb import pandas cgitb.enable() #print "Content-Type: text/plain;charset=utf-8" print "Hello World! Trying !!" I am trying to run it using this method mentioned on SO. Conten...

Can anyone please look into this? It's just not working for me.
Or is there any way to execute a python script on server and get the output in android application?
 
 
3 hours later…
8:33 PM
It's back so
 
8:50 PM
@TheLittleNaruto - Check this: paste.ofcode.org/gfppxiWxsD2jNCcRyepUMc
but, seems like java doesn't support returning two variables
 
that is why they introduce class
 
Hmm
 
I'll explain more about OOPs tomorrow.
 
Let me try it myself :p
 
It's 2:23AM over here. I gotta sleep.
 
8:53 PM
okay, np, 12.23:)
 
gn kid :) There is one more kid like you in this room -> @Hello
 
hi
I just wake up lol
 
:d
 
I can see that
 
8:55 PM
I'll sleep kids
 
gn man :d
 
:p good night
 
You guys carry on
gn
 
Yeah, seems like it is our time
So, your name is just Hello..
 
yup, Hello
 
 
1 hour later…
user5366495
10:15 PM
Can someone take a look at this: stackoverflow.com/questions/35398658/…
 
user5366495
@rekire @TheLittleNaruto @LinX64
 

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