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

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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

Attachments:

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 

http://vustudents.ning.com/group/cs201introductiontoprogramming/for...

My assignment solution please check if any error :)

Attachments:
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);

main()
{
char c;

do{
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: ";
cin>>x;
cout"Enter length of rectangle: ";
cin>>y;
cout"The Area of rectangle is: "x*yendlendl; 

}

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

cout"Enter base 1 of trapezoid: ";
cin>>base2;

cout"Enter height of trapezoid: ";
cin>>height;
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: ";
cin>>choice;

switch(choice) 
{
case 1:
AreaRect();
break;

case 2:
AreaTrap();
break;
default:

cout"\nInvalid Choice!\n"; 
}
cout"Do you want another calculation?: ";
cin>>repeat; 
}
system("pause");
}

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

dec

RSS

Looking For Something? Search Here

Latest Activity

Mirha Malik replied to +M.Tariq Malik's discussion CS501 Final Term Papers Spring 2020 & Past Solved Papers, MCQs for Exam Preparation in the group CS501 Advance Computer Architecture
18 minutes ago
Profile Icon+Anastasiya and iqra faiz joined Virtual University of Pakistan
39 minutes ago
AAESH ZEE replied to +M.Tariq Malik's discussion VU MSCS (MS Computer Science) Entry Test Past Papers
1 hour ago
AAESH ZEE replied to +M.Tariq Malik's discussion VU MSCS (MS Computer Science) Entry Test Past Papers
1 hour ago
AAESH ZEE replied to +M.Tariq Malik's discussion VU MSCS (MS Computer Science) Entry Test Past Papers
1 hour ago
Mani Siddiqui BS VIII posted a status
"*_شراب پلا کر مجھے بے دین نہ کر ساقی *_مدہوش ہی کرنا ہے تو محفل میں ذکر یار کر دے."
1 hour ago
Mani Siddiqui BS VIII liked +++**Zuni khan**+++'s discussion ❤️❤️❤️Rasool (S.A.W) Farmaty Hain ❤️❤️❤️
2 hours ago
Mani Siddiqui BS VIII posted a status
"زندگی بڑی عجيب ہے کبھی گلزار سی کبھی بیزار سی"
2 hours ago

HELP SUPPORT

This is a member-supported website. Your contribution is greatly appreciated!

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

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

.