siblers wrote: » JFlah, if you have the bike question done is there any chance you could post up the driver method? I can get the basic of it to work like displaying name etc, but trying to out the total value of the 2 bikes etc has me completley lost.
JFlah wrote: » import javax.swing.*; public class BicycleDriver { public static void main(String args[]) { String ownerName; double bicycleValue; String bicycleType; ownerName = JOptionPane.showInputDialog("Please enter your name: "); bicycleValue = Double.parseDouble(JOptionPane.showInputDialog("Please enter the value of the bicycle: ")); bicycleType = JOptionPane.showInputDialog("Please enter the make of the bicycle: "); Bicycle bikeOne = new Bicycle(ownerName,bicycleValue,bicycleType); bikeOne.setOwnerName(ownerName); bikeOne.setBicycleValue(bicycleValue); bikeOne.setBicycleType(bicycleType); Bicycle bikeTwo = new Bicycle(); ownerName = JOptionPane.showInputDialog("Please enter your name: "); bicycleValue = Double.parseDouble(JOptionPane.showInputDialog("Please enter the value of the bicycle: ")); bicycleType = JOptionPane.showInputDialog("Please enter the make of the bicycle: "); bikeTwo.setOwnerName(ownerName); bikeTwo.setBicycleValue(bicycleValue); bikeTwo.setBicycleType(bicycleType); double increasedPrice = bikeOne.getBicycleValue()+10; double totalValue = increasedPrice + bikeTwo.getBicycleValue(); JOptionPane.showMessageDialog(null,bikeOne.toString()+"\nIncreased Price: "+increasedPrice+"Eur\n\n"+ bikeTwo.toString()+"\n\nTotal Value of Bicycles: "+totalValue+"Eur"); } } It works , probably not the most efficient way I,m going to tackle it from a different angle tonight.
AntiRip wrote: » Absolutely nothing wrong with that really. If you wanted to you could pass the increased value within the method and there would be no need for the extra variable increasedPrice. bikeOne.setBicycleValue(bicycleValue+10); This can be passed in the output as bikeOne.getBicycleValue() then for the incremented value. No difference anyway I say as we all approach the questions differently. This was a far easier question than the continents one previous. How did ye get on with that one?
siblers wrote: » Was totally stumped, I'm struggling with the mutator method, like in the bike one where you want to increase the price of the first bike to 10, I didn't really know how to code it, if I can figure those bits out I wont be doing too bad. Also, did Catherine Woods get back to ye about the SAD? E-mailed her Wednesday with the system requirments and got nothing back yet, kinda annoying as I can't go any further till she gets back to me.
JFlah wrote: » Woo hoo ... week off to catch up on things!
siblers wrote: » Yeah, apart from SAD we don't really have assigments to worry about. I've no idea how far ahead to go with SAD though.
AntiRip wrote: » Go as far as you can with your DFDs and study Network Fundamentals! ;-)
siblers wrote: » Do you know how far into the lectures notes we are to go? Dont remember us doing any stuff beyond slide 20 of lecture 5.
JFlah wrote: » For which module??
siblers wrote: » I suppose that would help alright, its for Network Fundementals
JFlah wrote: » Luckily I am exempt from that module but from memory you,ll need to know upto what type of ip address a given address is and what addresses are restricted(network address,pvt address,loopback testing address) the CA in NF is handy all multiple choice questions.
siblers wrote: » For SAD are we supposed to have the class diagrams done? Don't remember doing them in class.
siblers wrote: » Nice one thanks. I've my DFDs done but im not entirely sure about my system requirments, feels like if you change one thing you end up changing a load of other stuff.
JFlah wrote: » People must be very busy!! tis fierce quiet here lately