|
This www page presents a set of Java programming exercises, and sample solutions, for (England, Wales and Northern Ireland) key stages 3 and 4 pupils. Each problem comprises (for download): (i) a .pdf file presenting the problem, (ii) a suite of .java source codes files and (iii) in some cases additional supporting material. All material made available in this collection of www pages is made available free of charge for non-commercial usage. However, except where otherwise indicated, it remains the copyright of the University of Liverpool. Should you choose to make use of any of the material for teaching purposes we would greatly appreciate appropriate acknowledgement.
If you have a particular example problem that you would like to share we would be happy to include this (with appropriate acknowledgement of course).
The problems are categorised as follows:
Under eaqch category problems are ordewred according to perceived difficulty.
# | Problem | Description/Notes | .java | |
---|---|---|---|---|
Sequence | ||||
1.1 | Giant Letters | First Java Program, sequence of function calls utilising no input and only simple print string output statements. | giantLetters2013-3-27.pdf. | GiantJava.java and GiantJavaApp.java. |
1.2 | Quote Item | Second simple java problem that includes declaration of a number of fields (Based on an AQA GCSE specimen controlled assessment problem). | quoteItem2013-4-28.pdf | QuoteItem.java and QuoteItemApp.java |
1.3 | Two Decimal Places Utility | Simple java problem that requires implementation of a static utility method. | twoDecPlaceUtility2013-5-3.pdf | Utility.java and UtilityApp.java |
Inheritance | ||||
2.1 | Landscape Gardening Quote (with inheritance) | Java problem that features inheritance. (Based on an AQA GCSE specimen controlled assessment problem). | landscapeGardQuoteInheritance1_2013-5-12.pdf | QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java and QuoteItemApp.java |
2.2 | Landscape Gardening Quote (with inheritance and totals) | More sophisticate version of the "Landscape Gardening Quote (with inheritance)" problem but with arithmetic operators. We also make use of the Utility class created previously. (Based on an AQA GCSE specimen controlled assessment problem.) | landscapeGardQuoteInheritance2_2013-5-7.pdf | QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and QuoteItemApp.java |
Keyboard Input | ||||
3.1 | Landscape Gardening Quote (Quote with Keyboard Input) | The landscape gardening quote problem with keyboard input using the Scanner class (Based on an AQA GCSE specimen controlled assessment problem). | landscapeGardKBinput_2013-5-7.pdf | QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and QuoteItemApp.java |
3.2 | Landscape Gardening Task 1(a): The Full Quote | Solution to landscape gardening AQA GCSE specimen controlled assessment problem Task 1(a) (with out the file output). | landscapeGardeningTask1a_2013-5-12.pdf | LandsGardQuote.java, Quote.java, QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and LandsGardQuoteApp.java |
Selection | ||||
4.1 | Triangle Recognition | Example requiring signifcant use of "if-else" statements. | triangles2013-3-30.pdf | TriangleRecog.java and TriangleRecogApp.java |
Repetition | ||||
5.1 | Menu Input | Example using a while loop (and switch and if-else statements). | menuApp2013-5-14.pdf | MenuApp.java |
Arrays | ||||
6.1 | Set Intersection | Example using arrays to represent sets and process them using a for loop (and switch and if-else statements). | setIntersection2013-5-14.pdf | SetOperations.java and SetIntersectionApp.java |
File Handling | ||||
7.1 | File Output Utility | Example Java utility class (that can be imported into her Java classes) to support file output. | fileOuput2013-5-14.pdf | FileHandlingUtility.java and FileOutputApp.java |
7.2 | File Input Utility | Extension of Java output utility class to include input and hence form a general file handling utility class.(that can be imported into her Java classes). | fileInput2013-5-14.pdf | FileHandlingUtility.java and FileInputApp.java |
Landscape Gardening | ||||
8.1 | Landscape Gardening Task 1(b) (with file handling) | Solution to landscape gardening AQA GCSE specimen controlled assessment problem Task 1 (generating and filing quotes). | landscapeGardeningTask1b_2013-5-12.pdf | FileHandlingUtility.java LandsGardQuote.java, Quote.java, QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and LandsGardQuoteApp.java. |
8.2 | Landscape Gardening Task 2 | Solution to landscape gardening AQA GCSE specimen controlled assessment problem Task 2 (saving customer quotes). | landscapeGardeningTask2_2013-5-12.pdf | FileHandlingUtility.java LandsGardQuote.java, Quote.java, QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and LandsGardQuoteApp.java. |
8.3 | Landscape Gardening Task 3 | Solution to landscape gardening AQA GCSE specimen controlled assessment problem Task 3 (loading new material costs). | landscapeGardeningTask3_2013-5-12.pdf | FileHandlingUtility.java LandsGardQuote.java, Quote.java, QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java and LandsGardQuoteApp.java (and data Files). |
8.4 | Landscape Gardening Task 4 | Solution to landscape gardening AQA GCSE specimen controlled assessment problem Task 4 (with quotes summary). | landscapeGardeningTask4_2013-5-12.pdf | FileHandlingUtility.java LandsGardQuote.java, Quote.java, QuoteItem.java, QuoteItemType1.java, QuoteItemType2.java, Utility.java, QuoteSummary.java, and LandsGardQuoteApp.java (Data Files: newMaterialCosts.txt, quoteNumber1.txt, quoteNumber2.txt, quoteNumber3.txt, quoteNumber4.txt, quoteNumber5.txt and quotesToDateFile.txt). |
Created and maintained by: Frans Coenen. Created: Tuesday 9 April 2013. Last update: Sunday 28 April 2013.