CS201 Assignment 01 Spring 2021 Solution / Discussion Due Date: 20-05-2021
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.
Tags:
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 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 – Introduction to Programming
Assignment No. 1
Semester: Spring 2021
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
Objectives:
To enable students to understand and practice the concepts of:
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 cs201@vu.edu.pk.
Lectures: 1 to 6
An expression is given here. You are required to write a C++ program that solves the given mathematical expression.
Z = x^{2} + 2xy – x/y
set the values of x = 2 and y = 1
Three main tasks are to be done by each student:-
After evaluation of above expression, you should add the value of z to last digit of your vu id. As a result,
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::
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::
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
#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++;
}
}
}
How to Get This Badge at Your Profile DP
------------------------------------
Management: Admins ::: Moderators
© 2021 Created by + M.Tariq Malik. Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents & non-commercial site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. All Contents on site are for personal & non-commercial use.We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post