Question: SET B Write a program to display the output of the following pattern a ) b ) a 1 , 2 b c d 3

SET B
Write a program to display the output of the following pattern
a)
b)
a
1,2
b c d
3,4,5,6
E,f,g,
(up to 8 rows)
Convert the following Decimals into Octal and
Hexadecimal
(ii)1456
(ii)123
c)9281
(iii)
3. Add / Subtract the following using their binary values (-123)+87
(ii)(-45)+(-45)
(iii)65+(-10)
4. Write a program to read a line of text, two character c1,c2 and remove the all the occurrence of Ch in it
Example:
Input: Computer is an electronic device C1='e'C2='''
Output :Computzr is an zlzctronicdzvicz
5. Write a program to remove all the duplicates in a String S.
6. In preparing the Invoice Bills, the customers are divided into three categories as , Regular, Frequent and Rare. To calculate bill for the customers, the following conditions are applied:
For Regular,
If the bill Amount is between 1000 to 5000,
Discount =0.05** Bill Amount
If the bill Amount is between 5001 to 10000,
Discount =0.075 Bill Amount
If the bill Amount is between 10001 to 25000,
Discount =0.1** Bill Amount
Above, Discount =0.125** Bill Amount
For Frequent,
If the bill Amount is between 1000 to 5000,
Discount =0.1 Bill Amount
If the bill Amount is between 5001 to 10000,
Discount =0.12** Bill Amount
If the bill Amount is between 10001 to 25000,
Discount =0.15** Bill Amount
Above, Discount =0.2** Bill Amount
For Rare,
If the bill Amount is between 1000 to 25000,
Discount =0.025** Bill Amount
If the bill Amount is between 25001 to 100000, Discount =0.05** Bill Amount
Above, Discount =0.75** Bill Amount
Additional Tax =0.25** Bill Amount
Write a C Program to read the type of the customer (String), Bill Amount and to calculate the Revised Bill amount for the Customer after deducting the bonus
7. Write a C Program to
a. Create a function getData() that takes a number n as input and gets n integers from the user. The getData() function also checks if the given input is odd or even. (1mark)
b. If the input number is even pass the even number to a function called evenSum() which gets the input from the getData() function and finds the sum of all the even numbers. (1 mark)
c. If the input number is odd pass the odd number to a function called oddSum() which gets the input from the getData() function and finds the sum of all the odd numbers. (1 mark)
d. Demonstrate the functions by calling getData and printing the values oddsum and evensum in the main () function. (2 marks)
Hint: Use static variables oddsum and evensum to keep track of the odd and even sums.
8. Write a C Program that takes the category of the employee and salary from the user and finds the bonus depending on category using Switch case statement. The conditions to calculate bonus are as follows:
if empcategory =1, if salary 50000, bonus =10% of salary
else bonus =7.5% of salary
if empcategory =2, if salary 25000, bonus =12% of salary
else bonus =8% of salary
if empcategory =3, if salary 40000, bonus =15% of salary
else bonus =10% of salary*/
 SET B Write a program to display the output of the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!