Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

Quesiton direct manipulation and virtual environments

Quesiton: "Direct Manipulation and Virtual Environments" Please respond to the following: • Your software development company has been contracted to build a tool that will manage user accounts and rights in an Active Dir ...

Kingston corporation is considering a new machine that

Kingston Corporation is considering a new machine that requires an initial investment of $550,000, including installation costs, and has a useful life of eight years. The expected annual after-tax cash flows for the mach ...

1 select one of the topics listed below and discuss

1. Select one of the topics listed below and discuss it. Describe an application that you have to solve by using at least 2 Excel functions. It can be Math, Statistics, Engineering, Financial, etc. Explain what Excel fun ...

What is the lithium by mass in a sample of pure lithium

What is the % lithium by mass in a sample of pure lithium carbonate that has a sample size of 10.0g?

A street vendor is asking people to play a simple game you

A street vendor is asking people to play a simple game. You roll a pair of dice. If the sum on the dice is 10 or higher, you win $10. If you roll a pair of 1's, you win $59. Otherwise you lose $5. If the random variable ...

Why is a mixture of ethanol and water needed to perform a

Why is a mixture of ethanol and water needed to perform a reaction between oil and NaOH? This question is from a soap lab where we made soap from oils.

Koh aq cuno32 aq precipitatekbr aq srno32 aq no

KOH (aq)+ Cu(NO3)2 (aq) = precipitate KBr (aq) + Sr(NO3)2 (aq) = no precipitate a) What are the possible products when solutions of KOH and Cu(NO3)2 are mixed? b) What are the possible products when solutions of KBr and ...

In your opinion if the government imposes unit sales tax ie

In your opinion, if the government imposes unit sales tax (i.e. $ tax per unit sold) on a product, will the market equilibrium change? Which one, demand or supply will shift? Increase or decrease? Will new tax cause "dis ...

Suppose you want to back up a huge file to a cd-r you can

Suppose you want to back up a huge file to a CD-R. You can do this by splitting the file into smaller pieces and backup up those pieces separately. Write a utility program named FileSplitter that splits a large file into ...

Recall that a k-ary tree is a rooted tree where each node

Recall that a k-ary tree is a rooted tree where each node has up to k children (for some positive integer k). (a) Write a recursive definition of a nonempty A-ary tree with height h greaterthanorequalto 0. (b) A complete ...

  • 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