---+ Using Netbeans with C++ In this activity we will be starting up the [[https://netbeans.org/][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. [[https://netbeans.org/][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 [[https://netbeans.org/][NetBeans]] 1 Turn on the computer 1 Log in using your email username, and password 1 Open the "Installed Software" folder. 1 Double click the ""NetBeans IDE 8.1" link" ---+++ Create a project 1 Click "File/New Project" 1 Categories "C/C++" 1 Projects "C/C++ Application" 1 "Next >" 1 Cange project name to "Rectangle" 1 Finish ---+++ Add code 1 Open the folder "Source Files" 1 Open "main.cpp" 1 replace the code with the code below: <sticky> %CODE{"c++"}% //C++ program to find the Area and Perimeter of a Rectangle: #include<iostream> using namespace std; int main() { int width,height,area,perimeter; cout<<"Enter Width of Rectangle = "; cin>>width; cout<<"Enter Height of Rectangle = "; cin>>height; area=height*width; cout<<"Area of Rectangle ="<<area<<endl; perimeter=2*(height+width); cout<<" Perimeter of rectangle are = "<<perimeter<<endl; return 0; } %ENDCODE%</sticky> -- %USERSIG{JimSkon - 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) ---++ Comments <br />%COMMENT%
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r5
<
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r3 - 2017-08-23
-
JimSkon
Home
Site map
KatiWeb web
KenyonCpp web
MSSC web
Main web
SCMP118 web
Fall2016 web
SCMP391 web
Sandbox web
TWiki web
Fall2016 Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback