CPPForSchool.com: Flow of Control Set 1: Assignment 8
8.
In a company an employee is paid as under:
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary.
If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary.
If the employee's salary is input by the user write a program to find his gross salary.
Once again, I am faced with an assignment that is utilizing unfamiliar terms. Like prior assignments, I will dive into the unknown with great confidence knowing that I will become well informed by the end of my journey. Nevertheless, I did a quick search on line and here are my findings:
HRA: I found acronyms that may be associated with this assignment, specifically House Rent Allowance and Health Reimbursement Account. By deductive reasoning, I will associate HRA as the House Rent Allowance because it comes to reason that the salary directly impacts the employee before health care accounts. According to Bank Bazaar,
"House Rent Allowance, as the term suggests, is an allowance granted by employers for employees to meet their house rent expenses. The salary of an individual will determine the HRA granted to him/her.
If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA = 90% of basic salary.
If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary.
If the employee's salary is input by the user write a program to find his gross salary.
Once again, I am faced with an assignment that is utilizing unfamiliar terms. Like prior assignments, I will dive into the unknown with great confidence knowing that I will become well informed by the end of my journey. Nevertheless, I did a quick search on line and here are my findings:
HRA: I found acronyms that may be associated with this assignment, specifically House Rent Allowance and Health Reimbursement Account. By deductive reasoning, I will associate HRA as the House Rent Allowance because it comes to reason that the salary directly impacts the employee before health care accounts. According to Bank Bazaar,
"House Rent Allowance, as the term suggests, is an allowance granted by employers for employees to meet their house rent expenses. The salary of an individual will determine the HRA granted to him/her.
DA: Based on my research, DA is an abbreviation for Dearness Allowance. According to Wikipedia,
"The Dearness Allowance (DA) is a cost of living adjustment
allowance paid to Government employees, Public sector employees (PSE)and
pensioners in India, Bangladesh and Pakistan. "
---------------------------------------------------------------------------------------------------------------------
Onward to the algorithms! First, the gross salary equates to the sum of the salary + HRA + DA.
From there, it was a matter of separating the flow for those who earn above 1500 or less than 1500. Below is my source code and output. Also, I included the sample run by CPPForSchool for comparison.
Comments
Post a Comment