0% found this document useful (0 votes)
331 views

LAB - 04 Bscs Fall 2018: Introduction To Computing

This document provides instructions for students on completing 7 tasks for a lab assignment on functions in C++. It outlines how to format files and folders, with each task in a separate .cpp file. It then lists the 7 tasks which involve writing C++ code using functions to initialize and print variables, input values, perform calculations like SUM and multiplication, and print outputs in formatted tables. Students are instructed to put all .cpp files in a single folder and submit it online.

Uploaded by

Ali Optimistic
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
331 views

LAB - 04 Bscs Fall 2018: Introduction To Computing

This document provides instructions for students on completing 7 tasks for a lab assignment on functions in C++. It outlines how to format files and folders, with each task in a separate .cpp file. It then lists the 7 tasks which involve writing C++ code using functions to initialize and print variables, input values, perform calculations like SUM and multiplication, and print outputs in formatted tables. Students are instructed to put all .cpp files in a single folder and submit it online.

Uploaded by

Ali Optimistic
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

INTRODUCTION TO COMPUTING

LAB – 04
BSCS FALL 2018

TOPIC: FUNCTIONS
COURSE INSTRUCTOR: SHAISTA SIDDIQUE

Faculty of Information Technology


University of Central Punjab
File and Folder Formatting:

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)

FILE SUMBISSION INSTRUCTION:


1. Put all the cpp files in a single folder.

2. Submit all the .cpp files on www.foitlms.ucp.edu.pk.

You might also like