Skip to main content

CS201 Assignment no 1 C++

 

Assignment No.  1
Semester: Spring 2021

CS201 – Introduction to Programming

Total Marks: 20

 

Due Date:20th May 2021

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 cs201@vu.edu.pk.   

Solution


#include <iostream>

using namespace std;

main()

{

cout<<"\tCS201 Assignment 1 Solution Spring 2021 (VUPORTAL.COM)" <<endl;

// Solving Expression

int x, y, z;

x=2,

y = 1;

z=(x*x) + (2*x*y) - (x/y);

cout<< "After evalution of given exression the value of z =" << z << endl;

//student 10 and Anylizing

string ID = "BC";

int id2 = 123456782;

string Name = "VUPORTAL.COM";

int lastdigit;

int Gotnumber;

//Evaluation of ID

lastdigit = id2 % 10;

cout<<"Last Digit of my VU ID is " << lastdigit << endl;

Gotnumber = 2 + lastdigit;

// If eLse Loop

// Adding Last digit of ID and Z and print resuLt Odd or Even

string test;

int n = 1;

if ((lastdigit % 2) == 0)


{

test = " even";

cout<< "I got an" << test << "number"<<Gotnumber <<endl;

while (n <= Gotnumber)

//cout<<"\tCS201 Assignment 1 Solution Spring 2021 (VUPORTAL.COM)" <<endl;

{

cout << "Iteration:" << n <<endl;

cout <<"My Name is: " <<Name <<endl;

n++;

}

}

else

{

test = "odd";

cout<<"I got an" <<test <<"number"<<Gotnumber <<endl;

//VUPORTAL.COM


while (n <= Gotnumber)

{

cout << "Iteration:" <<n <<endl;

cout <<"My Vu ID is:" <<ID <<id2 <<endl;

n++;

cout<<"\tCS201 Assignment 1 Solution Spring 2021 (VUPORTAL.COM)" <<endl;

}

}

}

if u need Unique Assignment File u can whatsapp 

03235459470




Solution File


 





Comments

Popular posts from this blog

CS601 Assignment no 1

                 CS601   Assignment No 1                  Solution Spring 2021                 Last date 19 May , 2021 SOLUTION FILE Download File PURPOSE OF VUPORTAL865.COM Virtual university is Providing quality of Education in Pakistan and Overseas too. Thousands of Students getting quality education. Virtual University of Pakistan is first university In Pakistan that providing online education to everyone in Pakistan. in this university online Education is easy and Affordable for everyone. Most students find trouble scheduling time for their assignments since the research work is a time-consuming activity. Even so, others find trouble writing their assignment due to a lack of writing skills. Such students need to worry no more since there are several available online assignment help ...

CS301 Assignment no1

        CS301 - Assignment   1   Solution   Spring   2021   #include <iostream> #include <string> #include <iostream> #include <string> #include <sstream> using namespace std; class node{ public: std::string name; short int coursecode; node* ptr; }; class student{ private: node* head; public: student(){ head = '\0'; } void insertStu(node**,node*); void newNode(); void showAll(int code); }; void student:: insertStu(node** head,node* newNode){ node* current; if(*head=='\0'){ *head=newNode; }else{ current=*head; } while(current->ptr !='\0'){ current=current->ptr; } newNode->ptr=current->ptr; current->ptr=newNode; cout<<endl; cout<<"student information save successfully "; } void student:: newNode()...

cs610

                                                                cs610