We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

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


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

#include <iostream>
// <stdlib.h> is for system("pause");
#include <stdlib.h>
int main()

{
       using namespace std;
      /*

      Please pray for me....
      Before submitting please change variables and then save against yourname.cpp
      This program is written by Ali Raza Marchal
      Student of Virtual University of Pakistan
      BSCS[Hons] 2nd Semester
      e-Mail ID: bc120403456@vu.edu.pk
      Join Group Study: Skype ID: alirazamirchal
      facebook.com/ali.mirchal

      Question: Write a program to calculate the slope of the line
      that is passing through two points and display 5 nature of slopw.
  
     */

      int X1, X2;
      int Y1, Y2;

      float slope, SlopX, SlopY;

      cout "Enter The X-Coordinate of the starting point = ";
      cin >> X1;

      cout "Enter The Y-Coordinate of the starting point = ";
      cin >> Y1;


       cout "Enter the X-Coordinate of the Ending point = ";
       cin >> X2;

       cout "Enter the Y-Coordinate of the Ending point = ";
       cin >> Y2;

       SlopX = (X2 - X1);

       SlopY = (Y2 - Y1);

       slope = (SlopY) / (SlopX);

       if(SlopX == 0){

       cout "Line is parallel to Y-Axis" endl;
      }

      else {

       if(SlopY == 0){
        cout "Line is parallel to X-Axis" 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 X-Axis and Less along Y-Axis" endl;
       }

      else {
 
               if(slope > 1){
                cout "Line will travel more along Y-Axis and Less along X-Axis" endl;
       }
             }
                       }

        }

 }
         system("pause");
         return false;
  }

 

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 3083

.

+ 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)

Replies to This Discussion

cs201 solution only 10% remaining which left for u

Asslamo alikum every one,Please if any one fined any mistake and any problem please tell me i will tanks for you. And prayer for me and every one , you can reply me on my email 

zahid_amz@ymail.com

kasuriamz@gmail.com


#include <iostream>
//<stdlib.h> for system pause;
#include <stdlib.h>


main()
{
//Declaring the variable;
int x1,x2,y1,y2;
float dy,dx,slope;
//Enter the value of satarting and ending point on x-axis and y-axis;
cout"Enter the X-Cordinate of the starting point=";
cin>>x1;
cout"Enter the Y-Cordinate of the starting point=";
cin>>y1;
cout"Enter the X-Cordinate of the ending point=";
cin>>x2;
cout"Enter the Y-Cordinate of the ending point=";
cin>>y2;
//calculate difference b/w x2 and x1;
dx=(x2-x1);
//calculate difference b/w y2 and y1;
dy=(y2-y1);
//calculate slope;
slope=(dy)/(dx);
if(dx==0)
{cout"Line is parallel to Y-Cordinate"endl;
}
else
{if(dy==0)
cout"Line is parallel to X-Corndinate"endl;
}
if(slope>1)
{cout"Line will travel more along Y-Axis and less along X-Axis"endl;
}
else
if(slope<1)
{cout"Line will travel more along X-Axis and Less along Y-Axis"endl;
}
if(slope==1)
{cout"Line will make the 45 degree angle with horizon"endl;
}
system("Pause") ;
}

Please don't put semicolon ; at the end of comments.

 Ali Raza Marchal BSCS[Hons] 2nd gud keep it up 

Note for All Members: You don’t need to go any other site for this assignment/GDB/Online Quiz solution, Because All discussed data of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

Please Do not copy paste its my orignal file

#include <iostream.h>

  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 = c-a ;
    // 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 = d-b ;
    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" ;
}
}
}
}
}

Put the symbol with every cout statement

pa g kdi right solution v  dy dita kro

cout statement mn sambol lagaian sir

#include<iostream.h>//header file hai apne lecture lain smjhj aa jaye gi

#include<conio.h>//header file hai

main() // jahan bhi ye braces hoon () is ka matlab hai wo function hoga to main() ek function hai ok

{ // main body of the programe yahan se shuro hoga yahan ap apna code likhain gay

int a,b,temp; // (int) means ye data jis ke baray hum programe likh rahay hain integer type hai.(variables) (a,b,temp; etc) variables hum code main memory locations aur data storing ke liye use krtay hain. is main variable a, ka matlab hai ke ek value user se lay ke a main store karni hai second value b main aur result ke liye hum ne temp liya hai. 

Cout"Enter your first value : " cout output lainay ke liye use kia jata hai

cin>>a; // cin for data input user se input lainay ke liye

Cout"Enter your second value : "

cin>>b;

The operator is referred to as the stream insertion operator. When this program executes, the value to the right of the operator, the right operand, is inserted in the output stream. Notice that the operator points in the direction of where the data goes. The characters of the right operand normally print exactly as they appear between the doublequotes. Notice, however, that the characters \n are not printed on the screen. The backslash (\) is called an escape character. It indicates that a "special" character is to be output. When a backslash is encountered in a string of characters, the next character is combined with the backslash to form an escape sequence. The escape sequence \n means newline. It causes the cursor (i.e., the current screen-position indicator) to move to the beginning of the next line on the screen.

#include<iostream.h> //header file 
int slope(int); //function declaration 
main ()
{
int x1; //declare the variables one on each line 
int x2;
int y1;
int y2;
cout"please enter the x co-ordinate of the starting point:"; //prompt user for input 
cin>>x1; //input entered by user
cout"please enter the y co-ordinate of the starting point:";
cin>>y1;
cout"please enter the x co-ordinate of the ending point:";
cin>>x2;
cout"please enter the y co-ordiante of the ending point:";
cin>>y2;

if(slope=1)
cout"line will make 45 degree angle with horizen";
if(slope<1)
cout"line will travel more along X-Axis and less along Y-Axis";
if(slope>1)
cout"line will travel more along Y-Axis and less along X-Axis";
}
{
int slope (int) //defination of slope function
slope=1;
slope=(y2-y1)/(x2-x1);

RSS

Latest Activity

+ ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! posted a discussion
6 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Jis Tarah ..
21 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Baat Karna ...
22 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Ghalti...
22 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Yaha Har Cheez ..
23 minutes ago
+ !! "AS" !! replied to + !! "AS" !!'s discussion Alfaaz Ki Nisbat..
24 minutes ago
Profile IconSafdar Mehmood, Shayaan, Hafiz muhammad sufyan and 28 more joined Virtual University of Pakistan
25 minutes ago
+ ! ! ! ! ! ! ReBeL replied to ٥ دن's discussion Gunahon ki gehrai
53 minutes ago
MUHAMMAD USMAN replied to MIT's discussion cs604 Quize#1 fall semester 2019 in the group CS604 Operating Systems
1 hour ago
+ ! ! ! ! ! ! ReBeL replied to +¢αяєℓєѕѕ gιяℓ's discussion Iss tasvir ko Unwan Dein :-P
1 hour ago
مخلص posted a discussion
1 hour ago
ambreen fatima and Muhammad Hamza Mehmood are now friends
1 hour ago
MIT added a discussion to the group CS604 Operating Systems
1 hour ago
sardarni liked + M.Tariq Malik's discussion MCM531 Community Journalism Assignment No 01 Fall 2019 Solution & Discussion Due Date: 22-11-2019
2 hours ago
sardarni joined + M.Tariq Malik's group
2 hours ago
blackeagle replied to + M.Tariq Malik's discussion EDU402 Curriculum Development Assignment No 01 Fall 2019 Solution & Discussion in the group EDU402 Curriculum Development
2 hours ago
sardarni joined + M.Tariq Malik's group
3 hours ago
sardarni joined + M.Tariq Malik's group
3 hours ago
+ "αяsαℓ " Ќąƶµяɨ •" replied to +¢αяєℓєѕѕ gιяℓ's discussion Shadi Ho Rhi Hai Alhamdulillah.......... (^__^)!
3 hours ago
+ "αяsαℓ " Ќąƶµяɨ •" replied to + "αяsαℓ " Ќąƶµяɨ •"'s discussion Happy Marriage to "Zee" & " Nomi weds Noor"....!
3 hours ago

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

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