General Election 2010 Picking Seats

From Progzoo
Revision as of 22:32, 21 October 2014 by Andr3w (talk | contribs) (Mc and Mac MPs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The class Seat includes the name of the constituency, the number of people eligible to vote. It also gives the name of the elected MP and his or her party. The name of the party that won the seat in the previous election (2005) is also given.

We will not be looking at the results field until later.

class Seat {
	public int index;
	public String place;
	public int electorate;
	public String mp;
	public String party;
	public String prev;
	public ArrayList<Mandate> results;

Seat 99

The ArrayList uk contains the details of several hundred parliamentary seats. Print the details of number 99. You should print:

  • place
  • mp
  • party
  • electorate

[Font] [Default] [Show] [Resize] [History] [Profile]

First and last

Print the first seat and the last seat.

[Font] [Default] [Show] [Resize] [History] [Profile]

Which are the Edinburgh Seats?

Print the place when it starts with "Edinburgh"

[Font] [Default] [Show] [Resize] [History] [Profile]

Mc and Mac MPs

For every MP whose name starts with Mc or Mac, show the party and the name.

[Font] [Default] [Show] [Resize] [History] [Profile]