Professional Documents
Culture Documents
Laboratory
Title of
Exercise 008 Divide Them All
Activity
No.
Page 1 of 1
LABORATORY EXERCISE
In this activity, you will be given a series of problems that will challenge your logical understanding of C+
+ covered by the modules, and not. For each problem, you are expected to create a project and write a
working solution depending on the requirements of the problem.
Objective/s:
At the end of this activity, the students are expected to be able to:
discuss the implications of the given problems
create functions and procedures that will implement the required process
call these functions to the main function to implement the required output
Material/s Needed:
Visual Studio Code
MinGW
Procedure:
1. Make sure you have a running version of the “Hello World” application shown in Module 004. If
not, review the steps to setup your Work Environment.
2. There will be a series of problems you are required to code. For each, you need to provide C++
codes for the actual solution.
3. Keep the project files for record as they may be requested by the instructor.
Questions:
1. Write a program that can divide six non-zero integers (two integers per division) from the user
and display the result to the user. Create a function that will perform the division operation.
Display only the non-decimal part of the quotient.
2. Write a program that will accept a short value from 10 to 99 and display them per digit (separated
by a space).
3. Write a program that will display the nth Fibonacci number. Create a function that will generate
the nth Fibonacci number. Fibonacci numbers are numbers from the Fibonacci sequence which
follows the pattern of 1, 1, 2, 3, 5, 8, 13, 21, 33, 54…
4. What can you conclude from this activity?