Question
QUESTION ONE a) Write single line statements to accomplish the following: i)Decrement a variable by 1 ii)Set up a constant named PAYRATE as 1000.00 using
QUESTION ONE
a)Write single line statements to accomplish the following:
i)Decrement a variable by 1
ii)Set up a constant named PAYRATE as 1000.00 using define preprocessor directive.
iii)Test if age is below 18 or above 65
iv)Print five blank lines, then print the message "its over".
b)A program is required to calculate an employee's net salary from the gross pay. The net salary is given by gross pay less deductions. Deductions include: 25% of gross pay as tax, KSh.250 as NSSF contribution and KSh.320 as NHIF contribution.
i)Design an algorithm (flowchart OR pseudocode) to illustrate this program.
ii)Implement the above program in C
c)Discuss and give examples of THREE major control structures used in the C programming language.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started