Turin polytechnic university in tashkent course of computer science
Download 246.39 Kb. Pdf ko'rish
|
2 5273896252356953600
- Bu sahifa navigatsiya:
- Example
- Exercise 5
- Exercise 6
TURIN POLYTECHNIC UNIVERSITY IN TASHKENT
COURSE OF COMPUTER SCIENCE LABORATORY PRACTICE n. 1 Exercise 1:
• Read two integer values x and y. • Compute their sum, storing it into an additional variable. • Display the result of the addition on screen. Is it possible to solve the same problem without using the additional variable?
• Loads an integer number n from the keyboard. • Prints out its immediately preceding and subsequent integer values. Example: assume that number 7 is introduced for n. Then, values 6 and 8 should be displayed. Exercise 3:
• Reads a real value t C , interpreting it as a temperature expressed in Celsius degrees. • Computes and displays the corresponding temperature value t F in Fahrenheit degrees. Recall that the two values are related by the relationship: t
= 5 · (t F - 32) / 9 Exercise 4:
Exercise 5:
Read two real value a and b from the keyboard, representing the coefficients of a first degree equation ax + b = 0 Find out and print the solution x of the equation itself Write down a Python program in order to: Write down a Python program which: Write down a Python program that: Write down a Python program which, once 3 integer numbers have been loaded from the keyboard, displays those same values but in the reverse order with respect to the one in which they have been read in. Write down a Python program able to:
Exercise 6:
Circumference length = 2 · π · r Circle area
Sphere surface
= 4 · π · r2 Sphere volume
= 4 · π · r3 / 3 Write a Python program that reads a real value r and computes: The length of the circumference with radius r The area of the circle with radius r The surface of the sphere with radius r The volume of the sphere with radius r Recall that: Download 246.39 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling