www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

# CS201 Assignment 01 Spring 2021 Solution / Discussion Due Date: 20-05-2021

CS201 Assignment 01 Spring 2021 Solution / Discussion Due Date: 20-05-2021

Views: 1459

### Replies to This Discussion

CS201 Assignment 1 Solution Guideline - Spring 2021. First Assignment has been uploaded and the due date is 20th May 2021. #cs201​ #spring2021​ #cs201assignment​
Here is complete CS201 Assignment 1 Solution Guideline - Spring 2021. This time first assignment is based on first 6 lectures.
An expression is given here. You are required to write a C++ program that solves the given mathematical expression.

Z = x2 + 2xy – x/y
set the values of x = 2 and y = 1

Three main tasks are to be done by each student:-
1. Expression solving
2. Decisions making (if-else structure)
3. Repetition structure (while loop).

After evaluation of above expression, you should add the value of z to last digit of your vu id. As a result,
1. If you get an odd number, then you should print your VU id using while loop. This while loop should run as many times as odd number you got from (z+ last digit of your vu id).
For example, suppose the value of z is 2 and the student’s id is BC123456781. Then by adding last digit of vu id 1 to value of z, result will be 3 which is an odd number. In this case, program should print your VU ID for 3 times using while loop.
1. If you get an even number, then you should print your Name using while loop. This while loop should run as many times as even number you got from (z+ last digit of your vu id).
For example, suppose the value of z is 2 and the student’s id is BC123456782. Then by adding last digit of vu id 2 to the value of z, result will be 4 which is an even number. In this case, program should print your Name for 4 times using while loop.

Share the Assignment Questions & Discuss Here....

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

# CS201 Assignment 1 Solution Spring 2021 ||Introduction to Programming|| C++ Coding

CS201 Assignment No. 1 Spring 2021 100% Correct Complete Solution By Abid Farooq Bhutta. CS201 Assignment 1 Complete Correct Solution Solved 2021 || Spring 2021 CS201 Solution Assignment no.1 2021 || Complete Correct Spring 2021 Solved. CS201 Assignment 1 Complete Solution Spring 2021,CS201 Assignment 1 Complete Solution,CS201 Assignment 1,CS201 ,CS201 Assignment 1 solution,CS201 assignment Spring 2021,CS201 assignment solution Spring 2021,CS201 assignment, Assignment 1 CS201 solution, solution CS201 Assignment 1, CS201 Assignment 1 solution 2021,CS201 assignment solution 2021,CS201 Assignment 1,CS201 Assignment 1 solution Spring 2021,CS201 Assignment no 1 solution Spring 2021,CS201 Assignment no 1 solution 2021,CS201 1rd assignment solution 2021,CS201 1rd assignment solution,CS201 1st assignment solution Spring 2021,assignment solution Spring 2021, #CS201​ #CS201assignment1solution2021

# ******

#include <iostream>
using namespace std;
//BC.............
int main(){
int x = 2, y = 1;
int z = x*x +2*x*y +x/y;
cout"After the evalution of given expression the value of z = "zendl;
cout"Last digit of my ID is 1"endl;
int result = z+1;
cout"I got an odd number of "resultendl;
if(result%2==0){
for(int i=1; i<=result; i++){
couti" My Vu id is BC........."endl;
}
}
else if(result%2!=0){
for(int i=1; i<=result; i++){
couti" My Vu id is BC.......... "endl;
}
}
return 0;
}

# CS201 Assignment 1 Solution 2021

CS201 – Introduction to Programming

Assignment No.  1
Semester: Spring 2021

## Instructions

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++

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 markSo, check your solution file format before submission.

Lectures: 1 to 6

### Assignment Question

An expression is given here. You are required to write a C++ program that solves the given mathematical expression.

Z = x2 + 2xy – x/y

set the values of x = 2 and y = 1

Three main tasks are to be done by each student:-

1. Expression solving
2. Decisions making (if-else structure)
3. Repetition structure (while loop).

After evaluation of above expression, you should add the value of z to last digit of your vu id. As a result,

1. If you get an odd number, then you should print your VU id using while loop. This while loop should run as many times as odd number you got from (z+ last digit of your vu id).

For example, suppose the value of z is 2 and the student’s id is BC123456781. Then by  adding last digit of vu id 1 to value of z, result will be 3 which is an odd number. In this case, program should print your VU ID for 3 times using while loop.

Sample screen shot::

1. If you get an even number, then you should print your Name using while loop. This while loop should run as many times as even number you got from (z+ last digit of your vu id).

For example, suppose the value of z is 2 and the student’s id is BC123456782. Then by  adding last digit of vu id 2 to the value of z, result will be 4 which is an even number. In this case, program should print your Name for 4 times using while loop.

Sample screen shot::

NOTE: Values of “z” and “student’s id” are arbitrary (not real).

If you face an error while doing this assignment Here is a YouTube video for this assignment.

#cs201 #assignament_1_2021 #cs201_assignment
cs201 assignment 1 solution 2021

# CS201 Assignment 01 Spring 2021 Solution

#include <iostream>
using namespace std;
main()
{
int x,y,z, vid=6,i=1;
x=2; y=1;
z= x*X + 2*x*y-x/y;
cout"After evalution of expression z values is :" zend1;
cout"Last digit of my vu id is :" vidend1;
vid= vid +z;
if(vid%2==1)
{
cout "i got an odd number "vidend1;
while(i<=vid)
{
cout "iteration :"iend1;
cout"my vu is id BC200202206"end1;
i++;
}
}
else
{
cout "i got an even number "vidend1;
while(i<=vid)
{
cout" iteration :"iend1;
cout"my name is Fatima "end1;
i++;
}
}

}

CS201-Assignment%2301-Solution-Spring-2021.cpp

1

2

3

4

5

## VIP Member Badge & Others

------------------------------------

## Latest Activity

Sufyan Butt updated their profile
1 hour ago
2 hours ago
Asad waqas added a discussion to the group PSY101 Introduction to Psychology

### PSY101 GDB 1 Solution Spring 2021 || psy101 gdb solution 1 || 100% Correct Solution

3 hours ago
3 hours ago
Mr. Khan! liked ＋ ꜞꜞ STrAnGEr ꜞꜞ ＋'s discussion مرحلے شوق کے دشوار ہوا کرتے ہیں
3 hours ago
Mr. Khan! liked Mani Siddiqui's discussion Create your Final term datasheet
3 hours ago
Mr. Khan! liked Laila kabeer's discussion Waqt badly ga tu.....
3 hours ago
Mr. Khan! liked иαвєєℓ αнмє∂'s discussion !!!!!!!!!! ONLINE EXAM !!!!!!!!!!
3 hours ago