Institute of Computer Science
  1. Courses
  2. 2020/21 fall
  3. Introduction to Programming (MTAT.03.236)
ET
Log in

Introduction to Programming 2020/21 fall

  • Home
  • Grading
  • Links

Homework 1

The deadline is Sunday, the 13th of September, 23:59 (Estonian time).

You have decided to buy a new TV set and do not know what size is best for you. Write a program that prompts the user for distance from the sofa to the TV set in meters. The program must compute and output the diagonal size of the TV set in inches suitable to your room (use the following formula: diagonal_size = distance * 100 * 0.39 / 2.5). Round the answer (you can use round for that, e.g. round(2.5) gives 3).

The program must compute and output the diagonal size of the TV set in inches suitable to your room.

 Enter distance (m): 4
 The suitable diagonal size is 62 inches.


 Enter distance (m): 2.75
 The suitable diagonal size is 43 inches.

Go to Moodle and upload your solution into Homework 1.

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment