0% found this document useful (0 votes)
42 views3 pages

Lectures: 1 To 6: Assignment No. 1

This document provides instructions for Assignment 1 for the course CS201 - Introduction to Programming. It states that the assignment is due on 9-12-2021 and outlines objectives related to programming concepts like data types, operators, and control structures. It provides submission instructions, noting that only the .cpp file should be submitted through the LMS and in the correct format. The assignment asks students to write a C++ program that prints their name and VU ID, adds the last 3 digits of their ID, displays the sum, and uses an if/else statement and loops to print their name or ID a number of times based on if the sum is odd or even. Sample output is provided.

Uploaded by

hamza tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views3 pages

Lectures: 1 To 6: Assignment No. 1

This document provides instructions for Assignment 1 for the course CS201 - Introduction to Programming. It states that the assignment is due on 9-12-2021 and outlines objectives related to programming concepts like data types, operators, and control structures. It provides submission instructions, noting that only the .cpp file should be submitted through the LMS and in the correct format. The assignment asks students to write a C++ program that prints their name and VU ID, adds the last 3 digits of their ID, displays the sum, and uses an if/else statement and loops to print their name or ID a number of times based on if the sum is odd or even. Sample output is provided.

Uploaded by

hamza tariq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment No.

1 Total Marks: 20

Semester: Fall 2021 Due Date: 9-12-2021


CS201 – Introduction to Programming
Instructions
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:

o Assignment is submitted after due date.


o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).

Recommended tool to develop Assignment


- Dev C++

Objectives:
To enable students to understand and practice the concepts of:
 Data Types and Variables
 Arithmetic and Logical Operators
 Expression solving
 If-else statements
 repetition structure

Assignment Submission Instructions


You have to submit only.cpp file on the assignments interface of CS201 from your LMS account. Assignment
submitted in any other format will be scaled with zero mark. So, check your solution file format
before submission.

For any query related to assignment, please contact [email protected].

Lectures: 1 to 6
Assignment

Write a C++ program that performs the following tasks:


1-Print your name and VU id.
2-Add last 3 digit of your VU id.
3-Display the result of sum on screen.
4-Use if-else statement ::
a) If sum is odd then print your name using while loop. Number of iterations of while loop should be equal to
the sum.
b) If sum is even then print your VU id using while loop. Number of iterations of while loop should be equal
to the sum.
[use remainder operator on sum value to determine the odd and even value for if condition]

For example, suppose the student id is BC123456781. Then by adding last 3 digits of vu id, we get 16 which is an
even number. In this case, program should print your VU ID for 16 times using while loop.

Sample screen shot::

Sample screen shot::


NOTE: Student’s name and id are supposed values (not real) in above example. You will print your own
VU Id and Name otherwise you will get zero marks.

You might also like