Total members 11890 |It is currently Tue Apr 23, 2024 11:07 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





When you draw a number of lines on a plane it divide the plane into number of parts ,you can calculate them by this C++ program
Code:
#include<iostream>
using namespace std;

int main()
{
   int n,i;
   char choise;
   cout<<"\n\n                                Cairo University          "<<endl;
   cout<<"                     Faculty of computers and information"<<endl;
   cout<<"                               CS - MATH SOCIETY"<<endl;
   cout<<"                            ---------------------"<<endl<<endl;
   cout<<"                                INFINITY  GROUP "<<endl;
   cout<<"                                      <><>"<<endl;
         cout<<"\n\n\tWhen you draw anumber of lines on aplane it divide the plane into\n\t\t\t\t anumber of parts .\n\t\t     We now can calculate them by this program. \n\n\t\t\t      ***lines and parts***";
   do
   {
      cout<<"\n\n\t\t\tThe number of lines =  ";
      cin>>n;
      i=((n*n)+n+2)/2;
      cout<<"\n\n\t\tNumber of parts  =  "<<i<<endl;
      cout<<"\n\tAre you want to test another number?(y/n)  ";
      cin>>choise;
   }
   while(choise=='y'||choise=='Y');
   cout<<"   \n\n                       *** WITH MY BEST WISHES ***"<<endl;
   cout<<"                                INFINITY  GROUP "<<endl;
   cout<<"                                      <><>"<<endl;
   cout<<"\t\t\tType Exit to close the program : ";
   cin>>choise;
   return 0;
}




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Lines on the plane
 Sphere by Lines     -  
 Drawing Lines in php     -  
 Draw Triangle using Lines     -  
 Script ingoring lines     -  
 increase the number of bank lines by <br/>     -  
 draw any number of lines on mouse clicks     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com