LAB1 – Command Line Compilation, the XCode IDE and XCode Debugging
Purpose: This lab will familiarize you with compiling C++ programs from the command line, using the C++ XCode IDE environment, and using the XCode debugger tool.
PART1 : Create and compile your first C++ program using the command line compiler.
-
- In order to run the following program, follow the instructions for command line compilation which can be found at this link. Copy and paste the following program into your Lab1.cpp file.
/* PROJECT: Lab1 assignment on command line compilation FILE: main.cpp PURPOSE: To illustrate the use of command line compilation PROGRAMMER: Your Name DATE: REMARKS: */ #include <iostream> //include the input/output classes using namespace std; //use the standard C++ namespace so names do not have to be fully qualified int main() { cout << "Hello World!\n"; //print Hello World! to the terminal followed by a return return 0; //successful termination of main
}
Ask questions if you run into problems. Verify, with the instructor, that you have successfully completed this part of the lab before continuing.
- Make the following changes to your first program, compiling and executing after each modification.
- Comment out the “Hello World! output statement.
- Declare three integer variables with the initial value of 0.
- Read three integer values from the keyboard and store in the integer variables declared in 2). Try to use cin instead of scanf – many online references.
- Print the three integer variable values of part 3) to the terminal with an appropriate string message. Try to use cout instead of printf – many online references.
- Compute and print the sum of the three integer variable values of part 3) to the terminal with an appropriate string message.
- Compute and print the average of the three integer variable values of part 3) to the terminal with an appropriate string message.
- Find and print the largest of the three integer variable values of part 3) to the terminal with an appropriate string message.
- Find and print the smallest of the three integer variable values of part 3) to the terminal with an appropriate string message.
Verify, with the instructor, that you have successfully completed this part of the lab before continuing.
程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB

本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝交易!
E-mail: [email protected] 微信:itcsdx
如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。
