Create a new file in the nano editor named hellocpp compile


Assignment

Lab Activity 1: Basic Compilation

Learnings

- Basic UNIX commands
- The Nano editor
- Compiling and running a C++ program

Part I: Getting to know Nano

Complete each step listed below and give the command you used to accomplish it.

1. Change your current working directory to the IFT250 directory

1. Using the Nano editor, create a file named first

2. Now in the file first, type the following on separate lines:

your first name, your last name, and your major.

3. Using the commands listed at the bottom of the screen, save what you have written

4. Once you have saved your work, exit the Nano editor.

5. Ensure that the file first exists and contains the content that you just typed.

Part II: Hello World!

Complete each step listed below and give the command you used to accomplish it.

1. If you are not already in the IFT250 directory, move there now.

2. Create a new file in the Nano editor named hello.cpp

3. Enter the following lines in the hello.cpp file:

//****************************************************
//
// your_name
// IFT250 Spring 2018
// Class Assignment 1
// File: hello.cpp
// Discription: print a message to standard output
// Compile: g++ -o hello hello.cpp
//
//****************************************************

#include
using namespace std;

int main() {
cout<< "Hello World!\n";
return 0;
}

1. Save the file as before and exit the Nano editor.

You have just created a C++ source file. While it is a valid program, it cannot be executed directly. First you must compile it into an executable program.

2. Compile the hello.cpp file into an executable file named hello using the command: g++ -o hello hello.cpp

3. Run the file using the command: ./hello

4. Take some to experiment with the program. Try figuring out what each line does, and even try to make the program output something different. Just remember to compile the program after you make changes.

Submissions

Once you've completed all the activities, perform the following steps for submission:

1. Ensure that all your answers as well as the files you created in this lab are correct and complete.

Lab Activity 2: The Vim Tutor

Learnings

- Basic usage of the Vim editor
- Vim commands and functions
- Using a command line text editor

Part I: the VimTutor

For this lab you will be following the instructions found in the VimTutor.

1. Move to your IFT250 directory and run the command vimtutor

1. As soon as the file opens, save it to your home directory by typing the following:

:wqLab2C.vim

Note the colon(:) as that lets Vim know you are typing a command.

2. This creates the file you will be editing for your lab. Any time the instructions have you close and reopen the tutor do so by typing:
vimLab2C.vim

3. Otherwise, follow the instructions for each lesson as they are written in the VimTutor file. Make sure to complete every tasks listed and you have saved all of your edits in the Lab2C.vim file

Submissions

Once you've completed all the activities, perform the following steps for submission:

1. Ensure your edited vimtutor file is saved to your IFT383 directory as Lab2C.vim

Lab Activity 3: File Attributes & Vi Editor

Learnings

- Using vi commands to edit/format files
- Explain the output of the long listing command with respect to file attributes
- Demonstrate ability to change file permissions in both relative and absolute way

Part I: Process Data

Consider the files L2E1.iva, L2E2.iva, and L2E3.iva on Blackboard along with this lab. This is the raw performance data collected on a solar photovoltaic module installed at the ASU Polytechnic campus. The 3 files correspond to 3 repeated measurements and must be processed to determine the performance output of the system or panel.

Download the L2E1.iva, L2E2.iva, and L2E3.iva files and upload them into the General server into the ~/IFT383/Unit2/Labs folder.

For this lab, you will use the techniques learned up to Unit 2 to edit and format the data from these three files to obtain a single file named lab2E.1.prc that resembles the following:

F gge0001x gge0001y gge0001z
D 12-30-2006 12-30-2006 12-30-2006
T 14:05:23 14:05:55 14:06:28
S a69 a69 a69
B 15.4 15.3 15.7
M gge06001 gge06001 gge06001
P 30.8 30.6 30.3
Q 19.2 21.1 23.5
R 1006.2 1006.6 1008
U 1012.7 1014.6 1014.1
X 36.2 36.1 36.6
A 38.994 38.994 38.994
G 107.71 107.71 107.71
H 8.411 8.433 8.434
O 37.084 36.705 36.508
C 7.537 7.621 7.546
K 28.198 27.623 27.574
W 212.52 210.51 208.08
L 68.1 68 67.6

You will use vi create a file called lab2E.1.sbs that explains the steps that you followed to create the processed file including all commands and pipelines.

Part II: Checking the List

For this part of the lab fill out the table below with the correct value and answer the following questions.

The following is the results of running the ls -al command on the directory tests:

11
drwx------ 2 kuitche kuitche 2048 Oct 23 20:59 awk
-rw------- 1 kuitche kuitche 808 Jul 24 2000 bin.doc
drwxrwxrwx 3 kuitche root 2048 Jul 12 14:04 junk
-rwxrwxrwx 1 kuitche root 21504 Jul 13 2000 this.jpg

1. Complete the table below

File name

File type

File size (in bytes)

File Owner

Group permissions

awk

 

 

 

 

bin.doc

 

 

 

 

junk

 

 

 

 

this.jpg

 

 

 

 

1. What is the size of the tests directory in bytes?

2. What is the command you would use to change the permissions on the file this.jpg the owner is able to read, write, and execute, the group owner is only able to read, and everyone else is able to read and execute?

3. What would be the output of the following sequence of UNIX commands?

bash3.2$ echo this is a script file > script.bash
bash3.2$ chmod 342 script.bash
bash3.2$ ls -al script.bash

4. If you do not know the existing permissions, how would you remove execute and write permissions from everyone but the owner of the file foo.sh without altering any other permission?

Submissions

Once you've completed all the activities, perform the following steps for submission:

1. Ensure that all your answers as well as the files you created in this lab are correct and complete.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Create a new file in the nano editor named hellocpp compile
Reference No:- TGS02632094

Now Priced at $45 (50% Discount)

Recommended (92%)

Rated (4.4/5)