Study Groups By Subject code Wise (Click Below on your university link & Join Your Subject Group)
[ + VU Study Groups Subject Code Wise ] [ + COMSATS Virtual Campus Study Groups Subject Code Wise ]
Looking For Something at vustudents.ning.com?Search Here
I have made my first cs201 assignment someone please tell me how I submit it ?
Tags:
sohail javaid (m.i.t 1st) upload it in CS201 assignment tab in your VULMS account...
rabia ya
tariq bhai just coding file upload karni hai na???
#include
int main()
{
using namespace std;
int X1, X2;
int Y1, Y2;
float slope, SlopX, SlopY;
cout "Enter The XCoordinate of the starting point = ";
cin >> X1;
cout "Enter The YCoordinate of the starting point = ";
cin >> Y1;
cout "Enter the XCoordinate of the Ending point = ";
cin >> X2;
cout "Enter the YCoordinate of the Ending point = ";
cin >> Y2;
SlopX = (X2  X1);
SlopY = (Y2  Y1);
slope = (SlopY) / (SlopX);
if(SlopX == 0){
cout "Line is parallel to YAxis" endl;
}
else {
if(SlopY == 0){
cout "Line is parallel to XAxis" endl;
}
else {
if(slope == 1){
cout "Line will make the 45 degree angle with the horizon" endl;
}
else{
if(slope < 1){
cout "Line will travel more along XAxis and Less along YAxis" endl;
}
else {
if(slope > 1){
cout "Line will travel more along YAxis and Less along XAxis" endl;
}
}
}
}
}
system("pause");
return false;
}
one more
#include
#include
main()
{
//Declaring the variable;
int x1,x2,y1,y2;
float dy,dx,slope;
//Enter the value of satarting and ending point on xaxis and yaxis;
cout"Enter the XCordinate of the starting point=";
cin>>x1;
cout"Enter the YCordinate of the starting point=";
cin>>y1;
cout"Enter the XCordinate of the ending point=";
cin>>x2;
cout"Enter the YCordinate of the ending point=";
cin>>y2;
//calculate difference b/w x2 and x1;
dx=(x2x1);
//calculate difference b/w y2 and y1;
dy=(y2y1);
//calculate slope;
slope=(dy)/(dx);
if(dx==0)
{cout"Line is parallel to YCordinate"endl;
}
else
{if(dy==0)
cout"Line is parallel to XCorndinate"endl;
}
if(slope>1)
{cout"Line will travel more along YAxis and less along XAxis"endl;
}
else
if(slope<1) {cout"Line will travel more along XAxis and Less along YAxis"endl; } if(slope==1) {cout"Line will make the 45 degree angle with horizon"endl; } system("Pause") ; } #include
main()
{
// Declaring variables for input (x,y) and (x1,y1)
int a,b,c,d;
// Declaring variables for formula dx(x1  x) and dy(y1  y)
float m,x,y;
cout "Enter the X  Coordinate of the Starting point = ";
cin>> a;
cout "Enter the Y  Coordinate of the Starting point = ";
cin>> b;
cout "Enter the X  Coordinate of the Ending point = ";
cin>> c;
cout "Enter the Y  Coordinate of the Ending point = ";
cin>> d ;
// acording to formula dx(x1  x)
x = ca ;
// show message if the resualt (x1  x)= 0
if (x==0)
{ cout "Line is parallel to Y  Axis ";
}
else
{
// show message if the resualt (y1  y)= 0
y = db ;
if (y==0)
{ cout "Line is parallel to X  Axis ";
}
else
{
// show message if the resualt (dy/dx )= 1
m = y/x;
if (m==1)
{
cout "Line will make the 45 degree angle with the Horizon ";
}
else
{
// show message if the resualt dy/dx > 1
if (m>1)
{
cout "Line will travel more along Y Axis And less along X Axis" ;
}
// show message if the resualt dy/dx < 1
if (m<1) { cout "Line will travel more along X Axis And less along Y Axis" ; } } } } }
#include <iostream>
int main()
{
using namespace std;
int X1, X2;
int Y1, Y2;
float slope, SlopX, SlopY;
cout "Enter The XCoordinate of the starting point = ";
cin >> X1;
cout "Enter The YCoordinate of the starting point = ";
cin >> Y1;
cout "Enter the XCoordinate of the Ending point = ";
cin >> X2;
cout "Enter the YCoordinate of the Ending point = ";
cin >> Y2;
SlopX = (X2  X1);
SlopY = (Y2  Y1);
slope = (SlopY) / (SlopX);
if(SlopX == 0){
cout "Line is parallel to YAxis" endl;
}
else {
if(SlopY == 0){
cout "Line is parallel to XAxis" endl;
}
else {
if(slope == 1){
cout "Line will make the 45 degree angle with the horizon" endl;
}
else{
if(slope < 1){
cout "Line will travel more along XAxis and Less along YAxis" endl;
}
else {
if(slope > 1){
cout "Line will travel more along YAxis and Less along XAxis" endl;
}
}
}
}
}
system("pause");
return false;
}
CS201 aSSIGNMENT SOL MAY 2013
#include<iostream.h>
#include<conio.h> main() { int d1,d2,e1,e2; float dx,dy; cout"Enter the X coordinate of the starting point="; cin>>1; cout"Enter the Y coordinate of the starting point="; cin>>e1; cout"Enter the X coordinate of the ending point="; cin>>2; dx=d2d1; // condition if(dx==0) { // statement cout"Line is parallel to Yaxis"; } else { cout"Enter the Y coordinate of the ending point="; cin>>e2; dy=e2e1; if(dy==0) cout"Line is parallel Xaxis:"; else { if(dy/dx==1) cout"Line will make the 45 degree angle with the horizon"; if(dy/dx<1) cout"Line will travel more along Xaxis and less along Yaxis"; if(dy/dx>1) cout"Line will travel more along Yaxis and less along Xaxis"; } } getch(); } 
#include<iostream.h>
using namespace std;
main()
{
int x1, x2, y1, y2;
float sx, sy, s;
cout"XCoordinate of the start point= ";
cin>>x1;
cout"YCoordinate of the start point= ";
cin>>y1;
cout"XCoordinate of the ending point= ";
cin>>x2;
cout"YCoordinate of the ending point= "
cin>>y2;
coutendl;
sx=(x2x1);
sy=(y2y1);
s=sy/sx;
if(sx==0)
{
cout "Line is Parallel to Y"endl;
}
else
{
if (sy==0)
{cout"Line is Parallel to X"endl;
}
else
{
if(s==1)
{cout"45 degree angle with the horizon"endl;
}
else
{ if(s<1)
{cout"more along XAxis and less along YAxis"endl;
}
else
{ if(s>1)
{cout"more along YAxis and less along XAxis"endl;
}
}
}
}
}
coutendl;
system("PAUSE");
}
e.g., see attachmnt 4 help its not the exact sol. its just for idea for the file to be upload.....
Ye lo g right solution n plz tarik bhai isa chk krna kahin koi fault ha kya
#include <iostream>
int main()
{
int X1,X2;
int Y1,Y2;
float slope,dy,dx;
cout"Enter the Xcoordinate of starting point:";
cin>>X1;
cout"Enter the Ycoordinate of starting point:";
cin>>Y1;
cout"Enter the Xcoordinate of ending point:";
cin>>X2;
cout"Enter the Ycoordinate of endind point:";
cin>>Y2;
dy=(Y2Y1);
dx=(X2X1);
slope=dy/dx;
if
dy==0dx==0
{
if dy==0
cout"Line is parallel to Xaxis.";
else
cout"Line is parallel to Yaxis.";
} else
{ if slope==1
cout"Line will make the 45 angle with the horizone.";
else
{if slope<1
cout"Line will travel more along Xaxis and less along Yaxis.";
else
cout"Line will travel more along Yaxis and less along Xaxis.";
}
}
}
n plz koi mja ya compile kr k bta day k m program thek ha ya ni bcs mra compiler ma kch garbar ha n wo cin and cout ko undeclare function show kr rha ha
+ About Us
+ Important for All Members Take a Look
Management: Admins ::: Moderators
Public Us On Google
Like Our Facebook Page
© 2015 Created by + M.Tariq Malik.
Promote Us  Report an Issue  Privacy Policy  Terms of Service
We are usergenerated contents site. All product, videos, pictures & others contents on vustudents.ning.com don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. 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 or Contact us at contact Page with copyright detail & We will happy to remove it immediately.

