Question: ASSIGNMENT 3: Doing Calculations Name: Station # Programming problem (Exercise #5, Ch 2): The floor of a room is to be covered with tiles, Room
ASSIGNMENT 3: Doing Calculations Name: Station # Programming problem (Exercise #5, Ch 2): The floor of a room is to be covered with tiles, Room dimensions (width, length) will be entered in METERS. Tile side values will be entered in centimeters cm square (c.g. 15 cm on each side). There is to be a gap of between each tile entered in MILLIMETERS. All Write a program that, given the room dimensions (in meters), works out the number of whole tiles required. Your program MUST meet the following criteria: 1. All calculations will be made within the program using variables (no calculations performed in a printf() statement... no calculations done in your head or with your calculator). Calculations that are done within the code of your program must include EVERY calculation including even SIMPLE conversions (like cm to m) 3. Use the pow(x,y) command to calculate the area of a tile. The pow(x,y) command requires the math.h library! 4. Print out each value entered. 5. Print out each of the following calculated values: room area, tile + gap area, number of tiles needed (as a whole number... no decimal places). Other program requirements (see rubric on page 2): You MUST have a comment line at the start of your program that contains YOUR NAME and YOUR PROGRAM NAME. You MUST use a printf statement that prints your name on your output. Q1: What types of values (int or float) will you need for the variables used within your program? Q2: What types of calculations require the math.h library in C (besides pow(x,y)? Give two examples: Q3: Write out the code required for your program below (BEFORE entering it into the computer)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
