[SOLVED] CS104 Homework 01

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

1.  Write a Python program which accepts the diameter of a circle from the user as command line argument, compute the area of the circle and print it to the screen.
2.  Imagine we have a sequence of numbers as follows:
3, , , , ,…
Write a program that prints nth number in this sequence.
For example if n is set as 2, it will print 2.5, if n is set as 4 it will print 1.125 etc. Please demonstrate the printing of the program for n=5, n=8, n=11.
3. Write a program that tells how many digits there are in a number? For example it will print “2” for 89, “5” for 43201 etc.
4.  Write a program that prints the following image.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.