5. Jan 2023
Objectives
At the end of this session, you able to
▪ Solve small-scale problems by using problem solving techniques.
▪ Design algorithms using flow chart / pseudocode.
▪ Write a program, compile and execute it.
▪ Explain the process of program translation and execution.
7. Jan 2023
Algorithm Design and Program Writing
1. Make a program that calculates and display the Body Mass Index (BMI) of a
person. The program should read the height and weight of a person being given
and display the BMI.
2. Write a program that prompts the capacity in gallons of an automobile fuel tank
and the miles per gallons the automobiles can be driven. The program outputs
the number miles the automobile cam be driven without refueling.
3. Write a program that converts a letter entered from the keyboard to its uppercase
or lower case equivalent (Hint :- use the function defined in ctype.h library header
file)
4. Write a program that find the result of the expression 𝑥𝑦 where the value of X
and Y are entered by the user.
8. Jan 2023
Cont. . . .
5. Design an algorithm and write a to read an employee name weekly working
hours, bonus rate per hour and base salary and find the employees gross-salary,
net salary and bonus payment. (Hint: pension rate – 5%, tax: 15%).
6. A serial transmission line can transmit 960 characters a second. Write a program
that will calculate how long it will take to send a file, given the file size. Test your
program on a 400MB (419,430,400 byte) file which may take days.
7. Identifying valid variables
8. Define a variable for a given entity/object/process
9. Expression preparation and evaluation.
9. Jan 2023
Reading Resources/Materials
eBooks
▪ Chapter 1, 2 & 3: Problem Solving With C++ [10th edition, University of
California, San Diego, 2018; Walter Savitch;
▪ Chapters 2 & 3: An Introduction to Programming with C++ (8th Edition),
2016 Cengage Learning; Diane Zak
▪ Chapter 2: C++ how to program, 10th edition, Global Edition (2017); P.
Deitel , H. Deitel