Program 2: Basic Elements in C++ Due on Sunday, 9/4/2022, by 11:59pm Lab Objectives This lab was designed to reinforce programming concepts from Chapter 2 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: • Get familiar with the C++ programming environment Create a C++ program with basic C++ program elements • Perform arithmetic operation in C++ program • Problem Description The steps to get started and finish the project: 1. Choose whatever compiler you like to work on programming for this project a. If you decide to use the GDB online C++ compiler, here is the URL: https://www.onlinegdb.com/online_c++ compiler b. Delete all existing code in the editor if there is any 2. Type this code into the blank editor and make sure it could build. Any C++ application must
Program 2: Basic Elements in C++ Due on Sunday, 9/4/2022, by 11:59pm Lab Objectives This lab was designed to reinforce programming concepts from Chapter 2 of C++ Programming: Program Design Including Data Structures, 8th Edition. In this lab you will practice: • Get familiar with the C++ programming environment Create a C++ program with basic C++ program elements • Perform arithmetic operation in C++ program • Problem Description The steps to get started and finish the project: 1. Choose whatever compiler you like to work on programming for this project a. If you decide to use the GDB online C++ compiler, here is the URL: https://www.onlinegdb.com/online_c++ compiler b. Delete all existing code in the editor if there is any 2. Type this code into the blank editor and make sure it could build. Any C++ application must
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Hi, can someone help me with this

Transcribed Image Text:CS120-02, TSU
Program 2: Basic Elements in C++
Due on Sunday, 9/4/2022, by 11:59pm
Lab Objectives
This lab was designed to reinforce programming concepts from Chapter 2 of C++ Programming:
Program Design Including Data Structures, 8th Edition. In this lab you will practice:
• Get familiar with the C++ programming environment
• Create a C++ program with basic C++ program elements
• Perform arithmetic operation in C++ program
int main()
{
Problem Description
The steps to get started and finish the project:
1. Choose whatever compiler you like to work on programming for this project
a. If you decide to use the GDB online C++ compiler, here is the URL:
https://www.onlinegdb.com/online c++ compiler
b. Delete all existing code in the editor if there is any
2. Type this code into the blank editor and make sure it could build. Any C++ application must
have a main function. This is the least C++ program.
Created by Li Ma
return 0;
3. Add the following code into the main function before the return statement to declare the
needed variables, make change as instructed in the comment if there is any
const double PI=3.1415926;
double rad; //for the radius of a circle
double circf, area; //for the circumference and area of a circle
4. Add the following two lines to the top of the code (before main function). They are the
preprocessor directive and name space definition, which are for cin and cout.
#include <iostream>
using namespace std;
5. Add the following code into the main function before the return statement to request a float-
point value

Transcribed Image Text:CS120-02, TSU
cout << "Please enter a floating-point value: ";
cin >> rad;
6. Figure out the code for the following pseudocode and add the code into the main function
before the return statement to process the following arithmetic calculations (you should figure
out what statements to use)
circf is the circumference of the circle with radius rad
area is the area of the circle with radius rad
Created by Li Ma
7. Add the following code into the main function before the return statement to output the
results
cout << "The circumference of the circle is " << circf << endl;
cout << "The area of the circle is " << area << endl << endl;
8. Build the program and correct your code if there is any error
9. Repeat step 8 till your program is bug-free
10. Run the program
11. Snapshot the whole compiler window (make sure the output is fully displayed) and save the
image as Program2_Arithmetic_YourName.png
12. Save your code as Program2_Arithmetic_Your Name.cpp
a. If you are using the GDB online C++ compiler, you must copy the code out to Notepad
and save the file as a .cpp file into your class folder
13. Submit your source code Program2_Arithmetic_Your Name.cpp (70%) and the picture
Program2_Arithmetic_Your Name.png (30%) to Blackboard via Program2 link in Assignments
section of the course page.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education