Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92664950
  • Price:- $45

Priced at Now at $45, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As