Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 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 1

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Calculus

Authors: Jon Rogawski, Colin Adams

3rd Edition

1319116442, 9781319116446

More Books

Students also viewed these Mathematics questions