Questions Based on Structures

1.  Write a program to prepare a invoice format from the following data: Customer number, customer name and address, date of sales, description, quantity, unit price, discount percentage, sales tax percentage.

2.  Details of 50 clients of an investment company are stored is an array of structure. Details include customer name, code, date of starting, and number of years, interest rate and total amount. Write a program to calculate compound interest for these clients.

3.  An array stores details of 25 students (roll, name, marks in three subjects). Write a program to create such an array and print out a list of students who have failed in more then one subjects. Assume 40% as pass marks.

4.  A linear array is size 50 stores following information's: name of the country, country capital and per capital income of the country. Write a program to do the following:

    i.  To read a country’s name and display capital and per-capital income.

    ii. To read name of the capital city and display country’s name and per capital income.

    Display an error message incase of an incorrect input.

5.  Write a program to prepare and print payroll (pay slip) of a group of employees for a particular month of the year. The employee information contains the following items: Name and Designation of employee, Basic Pay (BP), Special Pay (SP), Provident Fund (PF), Group Schemes (GIS), Income Tax Deduction (IT)

    City Compensatory Allowances (CCA) = Rs. 250

    Dearness Allowance (DA) = 114% for basic pay<3500,

                              85% for basic pay>3500 and <6000,

                              74% for basic pay>6000.

    House Rent Allowance(HRA) = Rs. 250 for basic pay<1500,

                               450 for basic pay>1499 and <2800,

                               800 for basic pay>2799 and <3500,

                               1000 for basic pay>3499.

    The program computes the above quantities, gross pay, total deductions and net pay and print in specified formats. (Hints: Gross = BP + SP + HRA + DA+ CCA, Net=Gross- (PF+GIS+ IT)

    Make use of structure and array in the program.

6.  Write a program to store 20 records containing country, capital and name of its president. The president name it is a record containing last name, first name, preface (Mr, Mrs, Miss). The program should display the entire record whenever the country name or capital name is given.

7.  Write a program to calculate income tax of a group of employees from the following data:

    Total income, life insurance premiums (LIC), unit linked insurance plans(ULIP), providend fund(PF), post-office cumulative time deposit(CTD), national saving certificate(NSC)

    Assume the following norms for the calculation of income tax:

    (A) Tax: Total income slab rates of income tax

        Upto 35000               nil

        From 35001 to 60000      20%

        From 60001 to 120000     30%

        Above 120000             40%

    (B) Exemptions: Contribution to LIC, GPF, PPF, ULIP, CTD etc. are exempt from paying income tax subject to a maximum of Rs. 12000 is admissible.

8.  A phone number such as (011) 711 8802 can be thought of as having three parts: the area code (011), the exchange (711), and the number (8802). Write a program using a structure to store 20 records of members where as each records store member number, member name and phone number of phone type. Have the user input the information for all the records and then display the entire information's on the screen.

9.  Design a structure that is suitable for holding a single CD. The structure should include at least the following member: a title of (maximum 20 char), an artist (max 20 char), a price, a music style (max 10 char) Write a Program, which allows the users to enter the details of those songs, which the user asks of a particular artist and print a tabular format showing the details.

10. Create a structure “report” containing name, standard, and marks in 3 subjects and total marks of a student, as a data member. Write a C++ program to input all the information's for 50 students. Sort the list in descending order of total marks and print the result. Use separate functions for inputting data, sorting and for output.

11. Using structure write a program that will accept time in minutes and seconds and convert it into hours.

12. Declare a structure student with following data members roll, name, three subjects m1, m2, m3 and total. The program should ask the number of students, if no is greater then 100 then display absurd entry and exit. Write a program to accept the data for the given structure and display the entered student list in proper format. It should also display the name and total marks of student who got highest.

13. An angle may be measured in degree and minute. Write a program to find the sum of two given angles. Create a structure name angle for that purpose. In the main program define three angles. Then ask the user to enter the values of two of them, then find the sum of these two angles and assign the sum into the third angle. Output the value of the third angle.