Using Netbeans with C++

In this activity we will be starting up the NetBeans C++ programming Environment, and trying it on on a simple program. The goal is to make sure we understand the basic programming environment and tools.

NetBeans is an IDE - an Integrated Development Environment. THis means it is a tool for writing, testing, and managing programing activities. It can be used with a variety of languages (such a Java), but we will be using it for the C++ programing language.

Start up NetBeans

  1. Turn on the computer
  2. Log in using your email username, and password
  3. Open the "Installed Software" folder.
  4. Double click the ""NetBeans IDE 8.1" link"

Create a project

  1. Click "File/New Project"
  2. Categories "C/C++"
  3. Projects "C/C++ Application"
  4. "Next >"
  5. Cange project name to "Rectangle"
  6. Finish

Add code

  1. Open the folder "Source Files"
  2. Open "main.cpp"
  3. replace the code with the code below:
//C++ program to find the Area and Perimeter of a Rectangle:

using namespace std;

int main()
    int width,height,area,perimeter;
    cout<<"Enter  Width of Rectangle = ";
    cout<<"Enter  Height of Rectangle = ";
    cout<<"Area of Rectangle ="<<area<<endl;
    cout<<" Perimeter of rectangle are = "<<perimeter<<endl;

    return 0;


-- Jim Skon - 2016-08-19

Run the Program

  • Hit the run button (green triangle)
  • Program runs in the "output" window.

Make your own

  • Create a new project, call it "Triangle"
  • Paste the rectangle program in to the main.cpp file
  • Modify to compute the area and perimeter of a triangle.
  • Remember: Area = 1/2(Base * height)


This topic: SCMP118/Fall2016 > WebHome > NotesDay1
Topic revision: r3 - 2017-08-23 - JimSkon
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback