Skip to main content

PRACTICE QUESTIONS SET 3


LIST OF PROGRAMS


41.       Using a menu driven program to calculate the area of three squares whose sides are x,y and x+3y respectively where x=2km, y= 5.5 km.
42.       WAP to create a menu based program to find the following depending on the user choice using switch
a.         Absolute value of a number
b.         Square root of a number
c.         Random number between 0 to 1
d.         Natural logarithm of a number.
43.       WAP to create a menu driven program to do the following:
a.         Area of Rectangle
b.         Diagonal of Rectangle
c.         Perimeter of Rectangle
44.       WAP to input a number and print it in words. [ 1- One, 2- Two……................] (Using switch)
45.       WAP to create menu based program to find volume of cube, volume of cuboids and volume of sphere.
46.       WAP to input the aggregate percentage and assign the respective stream as per the following conditions:

Aggregate %
Stream
>90
Science with computers
80-89
Science with Hindi
70-79
Commerce with computers
60-69
Commerce with Hindi
           
47.       Using a switch statement, write a menu driven program to convert a given temperature from Fahrenheit to Celsius and vice versa. For an incorrect choice, an appropriate error message should be displayed.
C=5/9 * (F-32) and F=1.8* (C+32)
48.       WAP to create a class salary to input the name, address, phone, subject, monthly salary, income tax and compute the annual income tax as 5% of the annual salary above Rs. 1,75,000/=. Display all the details after calculations.
49.       A cloth showroom has announced the following festival discounts on the purchase of items, based on the total cost of the items purchased: -

Total Cost
Discount (in %)
Less than Rs. 2000
5%
Rs 2001 to Rs. 5000
25%
Rs. 5001 to Rs 10000
35%
Above 10000
50%
Write a program to input the total cost and to compute and display 4he amount to be paid by the customer after availing the discount
50.       Normally a year is said to be a leap year if it is divisible by 4. But if the year is century year then it is not a leap year unless divisible by 400. For example year 1996 was a leap year. Century year 2000 was also a leap year but century year 2100 will not be a leap year as it is not divisible by 400. WAP program to accept a year and print the message whether the year entered is a leap year or not.
51.       WAP to input the code of a particular item, the quantity purchased and the rate calculate the total purchase amount and print it along with the gift to be presented. The gift to the customer is given on the following basis:

Amount of purchase (Rs)
Gift
100 and above but less than 500
A key chain
500 and above but less than 1000
A leather purse
1000 and above
A pocket calculator

At the end of the bill Thank You' must be printed.

Comments

Popular posts from this blog

unix commands