0% found this document useful (0 votes)
14 views1 page

Lab 2

Uploaded by

abdallah saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Lab 2

Uploaded by

abdallah saad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction To Programming.

1st year comm, electronic and


computer.
2nd Lab assignment.

Objective(s):
• To be more familiar with the data input from the user.
• To practice the use of different structures to control the program flow.

P. 1 Write a program to calculate the cost of carpeting a rectangular room in a house.


The program must do the following:
• Request the length and width of the room in meters.
• Request the cost per square meter of the carpet.
• Print the area and the cost, in a readable form.

P. 2 Power is the successive multiplication of a number by itself e.g. 23 = 2 * 2 * 2 = 8. Write a


program to ask the user for a number and an exponent then calculate the the power and
display it to the user.

P. 3 Write a program to print-out a complete set of multiplication tables for numbers from 1 to 10.
*

You might also like