Page 121 - Modular_V2.0_C++_Flikpbook
P. 121

PROJECT WORK










                                                                                              21 st  Century   #Critical Thinking
                 Project 1                                                                        Skills

                 Write a C++ program to convert the temperature given in Degree Celsius to Fahrenheit.
                 Project 2

                 Write a C++ program to take a number as input from the user and print a square of same
                 number of stars as shown:
                                                                                              21 st  Century   #Critical Thinking
                                                         *    *    *    *    *    *               Skills
                                                         *                          *
                                                         *                          *
                                                         *                          *
                                                         *                          *
                                                         *                          *
                                                         *    *    *    *    *    *
                 Project 3                                                                    21 st  Century   #Critical Thinking
                                                                                                  Skills
                 Write a C++ program to take the age and basic salary of an employee as input from the user and
                 calculate the gross salary on the basis of the following criteria:

                         If the age of an employee is greater than 18 and less than 45 years, then the HRA will be
                        5% and DA will be 10%.
                         If the age of an employee is greater than 45 years and less than 55 years, then the HRA
                        will be 7% and DA will be 12%.
                         If the user enters age greater than 55 years, then the message "Invalid Details" will be
                        printed.
                 The final output will be as shown:












                 Hint:
                      if(age > 18 && age < 45)

                 {
                     HRA = bsalary * 5/100;
                     DA = bsalary * 10/100;
                     GrossSalary = bsalary + DA + HRA;

                                                                                                                 119
                                                                                                   Project Work
   116   117   118   119   120   121   122   123   124   125   126