We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.


+ Link For Assignments, GDBs & Online Quizzes Solution


+ Link For Past Papers, Solved MCQs, Short Notes & More

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Views: 5320


Replies to This Discussion

Dear Fellows,

All of you are requested, Please post Only One Discussion for Current Assignment/GDB/Online Quiz and everyone reply/share/discussed his/her data on that same discussion, so that all members get solution & discuss easily on Current Assignment/GDB/Online Quiz.

So please don’t post two or more discussions for one Current Assignment/GDB/Online Quiz, hope you’ll understand and cooperate with us.

Already started discussion link for same assignment 


My assignment solution please check if any error :)

Preview of the Assignment: 

cs201 assignment 1 solution 2020 | CS201 Solved assignment 2020 with code file
cs201 correct solution 

BY Aamir Hafeez mc150400753@vu.edu.pk 
remove the above type your name and roll no
This program will calculate the area of rectangle and trapezoid
#include <iostream>
using namespace std;

double rectangleArea(double width, double length);
double trapezoidArea(double base1, double base2, double height);

char c;

int choice;
cout "\nEnter 1 to calculate area of rectangle\n";
cout "Enter 2 to calculate area of trapezoid\n";
cout "\n\nEnter your choice: ";
cin >> choice;

if(choice == 1)
double width, length;
cout "Enter the width of rectangle: ";
cin >> width;
cout "Enter the length of rectangle: ";
cin >> length;
cout "The area of rectangle is: " rectangleArea(width, length);


else if(choice == 2)
double base1, base2, height;
cout "Enter the base1 of trapezoid: ";
cin >> base1;
cout "Enter the base2 of trapezoid: ";
cin >> base2;
cout "Enter the height of trapezoid: ";
cin >> height;
cout "\nThe area of trapezoid is: "
trapezoidArea(base1, base2, height);


cout "\n\nDo you want to do another calculation: ";
cin >> c;
} while( c == 'y' || c == 'Y');

return 0;

double rectangleArea(double width, double length)
return (width * length);

double trapezoidArea(double base1, double base2, double height)
return ( height *( (base1 + base2) / 2) );

lstn m not  getting error in  namespace em not getting it
the error is nested name specifier before name space 
what is ths??

#include <iostream>
#include <stdlib.h>
using namespace std;

void AreaRect() 
float x, y;
cout"\n\nEnter width of rectangle: ";
cout"Enter length of rectangle: ";
cout"The Area of rectangle is: "x*yendlendl; 


float AreaTrap() 
float base1, base2, height, tarea
cout"\nEnter base 1 of trapezoid: ";

cout"Enter base 1 of trapezoid: ";

cout"Enter height of trapezoid: ";
tarea = ((base1+base2)/2)*height; // formula Area= ((b1 + b2)/2)*h
cout"\nThe Area of Trapezoid is: "tareaendlendl;

main() // functio to choice
int choice; 
char repeat = 'y';
while(repeat=='y' || repeat=='Y')
cout"\n\nEnter 1 to calculate area of Rectangle"endl;

cout"Enter 2 to calculate area of Trapezoid\n"endl;

cout"Enter your choice: ";

case 1:

case 2:

cout"\nInvalid Choice!\n"; 
cout"Do you want another calculation?: ";

please any body will help me to do cs201 assignment 1 due on 5



© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service