LAB - 04 Bscs Fall 2018: Introduction To Computing
LAB - 04 Bscs Fall 2018: Introduction To Computing
LAB – 04
BSCS FALL 2018
TOPIC: FUNCTIONS
COURSE INSTRUCTOR: SHAISTA SIDDIQUE
1. Create a folder for the lab (e.g. LAB-4, LAB04, LAB_4 etc.)
2. Create a cpp file after the task name along with lab number (e.g. lab4_task1.cpp,
lab4_task2.cpp etc.)
3. All the new cpp files created must be in new folder, create new folder for each separate
tasks).
4. Create separate cpp file for each tasks, i.e. the number of cpp files must be equal to the
number of tasks in lab.
LAB TASKS
ALL THE WORKING CODE SHOULD BE WRITTEN INSIDE A FUNCTION (NOT IN MAIN). USE
APPROPRIATE NAMES FOR FUNCTIONS. IF CODE IS WRITTEN OUTSIDE FUNCTION FOR TASK,
THE SAID TASK WILL NOT BE GRADED.
TASK – 01
Write a C++ code that initializes an integer variable with any given value and prints the variable
using cout statement.
TASK – 02
Write a C++ code that creates an integer variable and inputs its value using cin statement and
prints the entered value.
TASK – 03
Write a C++ code that creates an integer variable and inputs its value using cin statement and
prints the entered number’s table from 1 – 10 (*Note – x*1, x*2 etc.)
TASK – 04
Write a C++ code that creates two integer variables and inputs their value using cin statement
and prints their SUM, DIFFERENCE, PRODUCT AND DIVISION.
TASK – 05
Write a C++ program that creates 4 integer variables name Fuel, Rent, Bills & Total, the
program must input the first three variables and calculates their sum and print them in a
tabular form.
TASK – 06
Write a C++ program that creates variables for a result sheet and input their value from user
and print them in a formatted manner.
TASK – 07
Write a C++ program that inputs price and quantity of the following items and print the total
value. The items are Wheat, Rice & Sugar. (Value = Price * Quantity)