FS JS DOC01 Programming Constructs with NodeJS
FS JS DOC01 Programming Constructs with NodeJS
Programming
Constructs
NodeJs – CLI (Command Line Interface) Installation
• Step 1: Check Homebrew Package Manager is installed using
• brew –version - in the Terminal of Linux/Mac or in the Command Line of Windows
UC 3
Refactored code to write function for daily working Hours
A repetition construct causes
a group of one or more
4. Repetition
program statements to be
Statement
invoked repeatedly until
some end condition is met.
1. Fixed count loops - repeat a
predefine number of times.
4. Repetition for ( … ) { … }
Statement 2. Variable count loops - repeat
Types an unspecified number of
times.
while ( … ) { … }
for Loop Statement
Calculating Wages for
a Month assuming 20
Working Days in a
Month
UC 4
Calculating Wages for a Month
while Loop Statement
Calculate Wages till a
condition of total
working hours of 160 or
max days of 20 is
reached for a month
UC 5
Calculating Wages till Number of Working Days or Total Working
Hours per month is Reached
Thank
You