Semester: Spring 2013
CS201: Introduction to Programming Total Marks: 20
Due Date:02/05/2013
Instructions:
Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:
The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
Assignment is copied(partial or full) from any source (websites, forums, students, etc)
Note: You have to upload only .cpp file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks. For example, if you submit code in .doc (Word document) or .txt files or .exe file, no reward will be given in any case.
Objective:
The objective of this assignment is to provide hands on experience of:
Basic concepts of C/C++ language and Programming
Dealing with Data types
Conditional statements of C/C++ language
Expressions
Saving a program
Compiling a program
Executing the program
Guidelines:
Code should be properly indented and well commented.
Follow C/C++ rules while writing variable names, function names etc
Use only dev-C++ for this assignment.
Assignment
Problem Statement:
Write the C++ language program to calculate the slope of the line that is passing through two points and displays one of the following five messages according to the nature of the slope.
Message No Description
1 Line will make the 45 degree angle with the horizon
2 Line will travel more along X-Axis and Less along Y-Axis
3 Line will travel more along Y-Axis and Less along X-Axis
4 Line is parallel to Y-Axis.
5 Line is parallel to X-Axis. Detailed Description:
Your program will ask for the two inputs for the starting point P1(x1,y1) of the line i.e. X-Coordinate and
Y-Coordinate, and two inputs for the ending point P2(x2,y2) of the line i.e. X-Coordinate and