View
96
Download
0
Category
Preview:
Citation preview
Oops project Newton Second law of motion
PROJECT PREPARE BYKhurshidSU-14-01-071-046
Header file used and their Purpose IOSTREAM.H-input output stream header file
CONIO.H - to stable the output display.
Data typeThe data type we used in the program are float.
For example (float area etc.)
Definition of classClass are the combination of
functions and variables.
Working DescriptionThis Program is Designed for Newton second
law of motionThis Program consist of three options as
follows1. Create value of force2. Create value of horizontal distance3. Search moment of force
FUNCTIONSThere are three functions used in this
program.1. Void get_data2. Void show_data 3. Void formula
functionsVoid get_data:
Its purpose is to accept the data in which the user can enter.
functionVoid show_data: Its shows the data in the outputFor Example (Cout<<“multiple”<<a*b;)
functionsVoid formulaf=m*aF=forceM=massA=acceleration
Program Code#include<iostream.h>#include<conio.h>Class force{ private: float f,m,a public:
void get_data()
Cont….{ cout<<“enter the value of mass=“; cin>>m; cout<<“enter the value of acceleration=“; cin;} void formula(){ f=ma;}
Void show_data (){ “Newton second law of motion F=“ cout<<“force=“;Cout<<i<<endl;}};Main()
Cont…{ force l1,l2; l1.get_data();l1.formula();l1.show_data();l2.get_data();l2.formula();L2.show_data();getch();}
Recommended