In a make task you use the skills you have learned to create a program from scratch. There is no starter code: you begin with an empty editor.
A carpet fitter needs a quick tool to calculate the floor area of perfectly square rooms.
Write a program that:
print followed by
an input() that collects the answer, and converts the answer to a
float, since a length can have a decimal point in it,**, and stores it in a variable,Ask the question with its own print, exactly as written:
Enter the length of one side of the room:
The question is part of the checked output, so spelling, capital letters and
punctuation count. The tests also check your code: a program that does not use
the ** operator to calculate the area does not pass.
One line after the question, where AREA is the area you calculated:
The area of the room is AREA square metres
The length is a float, so the area is a float too. A side of exactly 4 metres
gives an area of 16.0, with the .0, and that is what the output shows.
Input:
2.5
Output:
Enter the length of one side of the room:
The area of the room is 6.25 square metres
Input:
4
Output:
Enter the length of one side of the room:
The area of the room is 16.0 square metres
Make sure that you check for the following things:
float() and not int(), since int() refuses a length with a
decimal point in it.input, and the second closing bracket
that float(input()) needs.** are written next to each other, with no space between
them.print is wrapped in str().is and
one before square.