Duplicate topic please check discussion!
CS201 Assignment 1 Solution and Discussion
Lion Games last edited by
Assignment No. 1
Semester: Spring 2022
CS201 – Introduction to Programming Total Marks: 20
Due Date: 10th June 2022
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
• Assignment is submitted after due date.
• Submitted assignment does not open or file is corrupt.
• Assignment is copied (From internet/students).
Recommended tool to develop Assignment
• Dev C++
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(like doc, docx, pdf, giff,jpg etc.) 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
Write a C++ program that performs the following tasks:
1- Print your name, VU id, and list of courses you have selected in current semester.
2- Print the names of all courses you have selected in the current semester.
3- Add first numeric digit of your VU id to the total number of courses selected.
4- Display the result of sum on the screen.
5- Print “Welcome to CS201-Introduction to Programming” by using WHILE loop. Number of iterations of WHILE loop must be equal to sum calculated in point 4.
For example, suppose the student id is BC123456781. Then by adding first digits of vu id=1, with number of courses (suppose =4), we get sum= 5.
Sum = first digits of vu id + number of courses
5 = 1 + 4
In this case, program should print “Welcome to CS201-Introduction to Programming” 5 times.
Sample screen shot::
NOTE: Student’s name and id are supposed values (not real) in above example.
You will print your own VU Id, Name otherwise you will get zero marks.