Gender Differences in Programming?
The
content of this web page formed part of a poster presented at the ITiCSE
2001 conference. Delegates were
presented with four fragments of code extracted from student assessments. They simply had to determine for each piece
of code whether a male or female student wrote it. Only 25% of respondents correctly deduced the gender of each
author.
Think you can do better? Take a look at the code
displayed here.
·
Did
a male or female student write it?
·
How
can you tell?
·
Are
you sure?
NoDeliveryException, NoCashierException{
Pump p = f.findPump(myTank.getFuelType());
// define a variable because expression too unwieldy
double amount = myTank.getCapacity() - myTank.getCurrentLevel();
System.out.println("Amount of fuel requested: "+amount);
System.out.println("Fuel level before delivery: "+
myTank.getCurrentLevel());
p.deliver(myTank, amount);
System.out.println("Fuel level after delivery: "+
myTank.getCurrentLevel());
Cashier c = f.findCashier();
c.receivePayment(p);
}
}
class Pump{
public Pump(Vector myTanks){
myTanksList = new Vector();
myTanksList = myTanks;
}
// accessor
public double getCostOfLastDelivery(){
return costOfLastDelivery;
}
// method to invoke fuel delivery from forecourt tank
public void deliver(Tank car, double quantityRequested)
throws NoDeliveryException{
for(int i = 0; i < myTanksList.size(); i++){
ForecourtTank ft = (ForecourtTank) myTanksList.elementAt(i);
if(car.getFuelType() == ft.getFuelType()){
costOfLastDelivery =
ft.deliver(quantityRequested, car)*ft.getCostPerLitre();
· Where have all the
girls gone? What entices female students to apply for Computer Science degrees
· Arresting the
Decline: how can we encourage female students back into Computer Science.
· Gender Differences in
Learning to Program.
· Gender and
Programming: what's going on?.