Worksheets on Algorithms | Pseudocodes to Download:

Click on each Question to get the Worksheet.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1 - Write an algorithm/pseudo-code, on monitoring temperature for 24 hours. Calculate the temperature and set the thermostat on 24º C. Test the thermostat to maintain the state/s of temperature goes higher and lower than 24º C and sets back to 24ºC.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2- Write an algorithm/pseudo-code, on dispensing cola cane on $1 coin. Test the dispenser to accept and reject the coin, if it is greater or lesser than the value of the $1 coin and if it is the same $1 coin then dispense cola cane.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

3- Write an algorithm/pseudo-code on calculating total number of books in a class for 30 days of 20 students class, where all students have to bring 5 books including (Mathematics, Physics, Chemistry, Computer, English). Additional, there are some students who don’t bring all the books.

Required:
1. Calculate total number of books in a class.
2. Total number of all 5 books.
3. Calculate total number of partial books students who don’t bring all the books.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

4- Write an algorithm/pseudo-code to find the correct house (RED, GREEN, BLUE, YELLOW). Students have worn these color codes, when they come to the entrance the door directs them to their perspective dress code door. Total number of students is 500 distinguish and direct each student according to their dress color code.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

5- Write an algorithm/pseudo-code to distinguish for school voting for head boy, captain, house captain and deputy head boy. Calculate total vote casting, vote wasted, position of head boy, deputy head boy, captain and vice captain.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

6- Write an algorithm/pseudo-code to assign a job based no candidate qualification and experience. Test that if the candidate having qualifications with masters and inexperience put his/her status to waiting list. On the other hand, test the condition for both qualification and experience that the candidate possesses masters qualification and having experience for more than or equals to 5 years, appoint them a job for  these particular benefits including (transportation, house rent and 10% additional increase in salary for being experienced for 5 or more years).

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

7- Write an algorithm, or otherwise, a cricket field requires a system in which it calculates total balls delivered to a batsman and total balls bowled by a bowler and total runs taken by the batsman on each ball or dotted the ball as well. It also includes the name of the player and the name of the bowler, most wicket taker and the most maiden overs and total overs bowled, players name, bowlers name and team name as well. Also calculate total boundaries for 4’s and 6’s, No balls, wide balls, Left balls by the player, extra hit and wicket fall and wicket taken by the bowler.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

8- Write an algorithm or otherwise, to count the lights on/off in a day. The system has to categorize bulbs, tube lights, fans and other electrical appliances. Calculate for each light remained on and off for the whole day.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

9- Write an algorithm, or otherwise, using flowchart a motor biker drives a bike at different speed. S/he researches for gear position. When he drives a bike in first gear he keeps the accelerator up to 20, when he changes the gear to second gear, he then increases the speed up to 40% higher than 20*40/100=8 (20+8=28). When he changes the gear to third gear, he then further increases the speed by 30% and finally he changes the gear from third to 4th gear by applying 35% more acceleration. He follows the same procedure till 4th gear for one day, every day he increases the speed by 2% repeatedly. Show all values and final speed and fourth gear speed. Apply validations where necessary. Dry run and trace the algorithm.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

10- Write an algorithm to take 100 values in x and y respectively. Test x against y and display weather x is greater or y is greater, while comparing x and y. calculate total of x and y. Also, include average of x and y values. Test for odd and even in x and y. calculate total odd and even in x and y. Show output for each calculation.

 

 
Get latest updates by following us @csacademydev - 04:15 PM