You have been asked to write a program to calculate the area of a wall and the cost of the tiles needed to cover it. The program should work for any room with up to four walls being tiled. Tiles are sold in boxes; each box covers one square metre.
Tile Description | Price Per Box |
---|---|
Small black granite | $19.50 |
Small grey marble | $25.95 |
Small power blue | $35.75 |
Medium sunset yellow | $12.50 |
Medium berry red | $11.00 |
Medium glitter purple | $52.95 |
Large oak wood effect | $65.00 |
Large black granite | $58.98 |
Large bamboo effect | $85.00 |
Extra-large white marble | $62.75 |
Write and test a program or programs to calculate the area of the walls and the cost of tiles needed to tile a room.
- Your program must include appropriate prompts for the entry of data; data must be validated on entry.
- Error messages and other output need to be set out clearly and understandably.
- All arrays, variables, constants, functions and procedures must have meaningful names.
In addition to the C# code your project should also include:
- a structure chart showing modules and parameters
- a program flowchart showing one section of your choice from your program
Your C# code, structure chart and program flowchart should be submitted into the evidence document on Classroom.
A description of the program is on the next page.
Set up your program to:
- Store the tile description, price per box and an identification code using a suitable programming technique.
- Display the list of tiles including the identification code, description and price per box
- Prompt the user to input the height and width of the wall, and the identification code of the tiles they would like.
- Calculate and display the area of the wall, the number of boxes of tiles required (tiles are sold in boxes of complete square metres) and the total cost of the tiles.
Extend your program to:
- Enter the number of walls to be tiled and the identification code of the tiles to be used. Only one identification code to be used for all walls.
- Enter the dimensions for each wall to be tiled.
- Calculate and display the total area of all walls, the number of boxes of tiles required (tiles are sold in boxes of complete square metres) and the cost of the tiles.
It is likely that some of the tiles will not be useable, so it is sensible to allow a percentage for wastage, for example 10%. Alter your program to allow the user to input a percentage to calculate wastage and add this to the total area to be tiled. Calculate and display the revised number of boxes of tiles to be purchased (tiles are sold in boxes of complete square metres) and the total cost of the tiles.
Marks will be awarded based on the following areas:
- meaningful identifiers used throughout
- comments describing key sections of code and the purpose of each user-defined module
- following C# programming conventions throughout (such as declaring variables, arrays and constants at the top of modules, camelCase spelling, suitable line indentation)
- use of suitable prompts and output messages/error messages to the user
- user input is validated where appropriate
- suitable use of programming constructs: sequence, selection, iteration
- the completion of each programming task
- a complete structure chart
- an accurately-drawn program flowchart