0% found this document useful (0 votes)
11 views

Programming First Batch (Suquence) 1-14

Cs A2

Uploaded by

faiqakhaannn
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)
11 views

Programming First Batch (Suquence) 1-14

Cs A2

Uploaded by

faiqakhaannn
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
You are on page 1/ 2

Programming Assignment

First Batch
Suequence

Note: These tasks are to be solved in a programming language and in Pseudocode. Where instructed
give the output as given using concatenation operator of selected langauage and & for pseudocode.

Task # 1 : Input the length and width of a rectangle and print the area and perimeter.

Task # 2 : Input the time in hours and minutes. Convert this time in to minutes and print the time in
minutes.

Task # 3 : Input two numbers A and B, Swap and print them.

Task # 4 : Input the marks obtained by a students in three tests. Input the Maximum obtainable marks
also. You may assume that all test have the same Maximum obtainable Marks. Print the Total Marks,
Total Percentage and Average Marks of the Student. Your output must all be in one print statement
using concatenation of variables and string constants.

Task # 5 : Input the unit price and quantity of an item sold. Calculate the total and Tax. Tax is 17.5% of
the total. Print the total, Tax and Total Payable.

Task # 6: Input the temperature in Centigrade, convert and print in Fahrenheit e.g

If the user enters 100 centigrade your program should print 212 Fahrenheit.

F =32 + 9*C/5

Task # 7: Input the name, age and Salary of a person. Give the following output.

Mr. XXXX after five years you will be XX years old. Your salary is XXXXXX. I hope this is monthly.

Salary is a float variable so you must use the float function rather than int.

Name is String so you will not use int or float function.

Task#8: Input three real numbers. Your program should work like the shown below

What is your First Number ? 1.1

What is your second number ? 2.2

What is your Third Number ? 5.5

( 1.1 + 2.2 + 5.5 ) / 2 is equal to 4.4


Task # 9 : Input the time in minutes, convert and print in hours and minutes.

Task # 10: Input the numbers of oranges purchased by a customer. Print the number of boxes needed
for packing if a box can hold 8 oranges. Also print print how many oranges will be left unpacked because
we must have 8 oranges in one pack.

Task # 11: Input the number of pages a students wants to print. The shop sells pages in either packets or
loose sheets. The cost of one packet is

Rs. 300 /- and it has 100 pages.

The Cost of one loose sheet is Rs. 5/-.

So if a students wants to print 230 pages he will need to pay for two packets and 30 loose
sheets. Print the total bill for the student, you must print both costs individually and then total
cost. With this sample data your output shoud look like

Packet Cost for 2 packets is 600.

Loose Sheet cost for 30 sheets is 150.

Total payable cost for 230 pages is Rs. 750.

Task #12: Input the time in seconds and print in hours , minutes and second.

Test your program with 4000 seconds . Your output should be in the given format.

1 hr, 6 min, 40 seconds

Task #13: Input a 4-digit number and print the sum of its digits. You may assume that user will only enter
4 digit number and invalid data will not be entered.

Task # 14: Input a 4-digit number and covert it into its reverse and print it. for example user enters 1234
convert it to 4321. Dont just print them in reverse order, they must be saved as one number.

=================================== END OF SEQUENCE ================================

You might also like