Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Copy the directory lab5 from the cis18b directory. This is the directory where you will do your work for Module 5 lab. In this directory are some source files that work together to allow the user to multiply 2 integers (yes, the code is a no-brainer but this isn't a programming class). The source files are:

main.cpp: coordinate the other source files, main calls functions in input.cpp, mul.cpp, and output.cpp
input.cpp: get 2 integers from the user
mul.cpp: multiply the 2 integers
output.cpp: print the product
Except for main.cpp, each source file has its own header file

2. Write a makefile that:
· Builds an executable called mul.exe from the C++ source files, when you type: make
and at the end of the build, prints the text: filename is built (where filename is the name of the executable)
· Allows you to compile each source file individually by typing: make filename.o
· Has 4 macros, for: the compiler name, compiler flags, file dependencies, and name of the executable
Set the compiler name to g++ , set the compiler flags to print all warnings, set the executable to mul.exe

3. Turn on the script utility to capture your screen output
4. Run make to create the output.o file. Then do a listing of the directory to show that only this file was created.
5. Run make to build the executable. [Outside of script, just for "fun" you can run the executable by typing its name on the command line]
6. Use one command line to delete from the file input.cpp the line:
cout << "Read in " << n1 << " and " << n2 << endl;
You should not have to use vim or a text editor, and you should not have to use a line number to select the line.
7. Build the executable again, except this time have the executable be named myApp.exe
8. Use echo to print an explanation of why the build in step 7 is shorter than the build in step 4.
9. Exit out of script and save the script output file
10. Modify the makefile so that it has the following additions:
· when you type: make clean
it will delete all object files and the executable file (only source files should be left)
· when you type: make list
it will list all the .cpp files
· when you type: make
it will rebuild if necessary, and copy the up-to-date version of the executable to your home directory
· when you type: make rebuild
it will recompile all source files and rebuild the executable, regardless of whether the files are up-to-date or not
11. Start the script utility again to capture screen output
12. Create 2 empty files in the current directory called clean and list
13. Run: make list (only .cpp files should be listed)
14. Run: make clean (all object and executable files removed)
15. Run: make (new executable built and copied to home directory)
16. Run a command to show that the executable is at your home directory
17. Run: make rebuild (new executable rebuilt, even though all files are up to date)
Do not run make recursively to solve this step. This means the makefile should not have a rule that runs make.
18. Exit out of script and save the script output file and your makefile

Module 6

1. Go to the lab5 directory (where you have your C++ files from Module 5)
2. Turn on the script utility to capture your screen output
3. Create a bin subdirectory and copy the executable file to the bin subdirectory
4. Run make to remove all .o files and executable file from the current lab5 directory
5. Run the tree command to show the directory tree of the lab5 directory
6. Create a tar file of all the .c files
7. Add the .h files to the tar file
8. Add the bin subdirectory to the tar file
9. Do a long listing of the tar file to see its size
10. Compress the tar file
11. Do a long listing of the compressed tar file to see its size
12. Create a subdirectory called lab5Copy. Copy the compressed tar file to the lab5Copy directory, and then go to the lab5Copy directory
13. Use one command, reconstruct your lab5 directory from the tar file
14. Run the tree command of the reconstructed directory to show that it's identical to the original lab5 directory.
15. Exit out of script.

You should now have a script output file of Module 5 and a script output file of Module 6

16. Remove any control characters, typing errors, command errors, and/or extra commands in both files.
17. Make a copy of the 3 files that you created for this lab: the 2 script output files (of module 5 and module 6) and your makefile (from module 5) , and rename all 3 copies with extension .txt
18. Prepare the 3 .txt files for text editing on Windows.
19. Use one command to create a compressed tar file of all 6 files (3 original files and 3 copies with .txt extension). Name the tar file lab5-6, and with the correct filename extension to show that it's a compressed tar file.

20. Transfer the tar file to your local system and upload it to Catalyst

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91606134

Have any Question?


Related Questions in Computer Engineering

Sql transactions exercisesperform the test for the

SQL Transactions Exercises Perform the test for the non-additive join property (lossless join) for the relation R(A 1 , A 2 , A 3 , A 4 , A 5 ), and the decompositions D a , D b , D c , D d  and set of functional depende ...

Consider the market for small business loans in the context

Consider the market for small business loans. In the context of this market. How adverse selection impact lenders. How does adverse selection impact borrowers? In the context of this market provide 2 things that a lender ...

Systems analysis project personal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

Software quality is a difficult term to define it means

Software quality is a difficult term to define. It means many things to many different people. Consider the following What do you think software quality is composed of? Why is quality so difficult to define? Do different ...

Junit test labyou will be creating a junit test class for

JUnit Test Lab You will be creating a JUnit Test Class for Gradebook.java, that has been provided for you.   Add a getScoreSize() method to the Gradebook class which returns scoresSize; Add a toString() method to the Gra ...

C programminghelp with a program positivec that include the

***C PROGRAMMING*** Help with a program positive.c that include the following function: void extract(int *a, int n, int *positive, int *size); The function should use pointer arithmetic, not subscripting. The extract fun ...

Question what are four important tactical tasks for a

Question: What are four important tactical tasks for a negotiator in a distributive situation to consider? Discuss one instance where you have been involved in distributed bargaining. What was the outcome? The response m ...

Jamie dimon changed the business model for jpmorgan chase

Jamie Dimon changed the business model for JPMorgan Chase in 2008. In the process, the bank gave enormous trading authority to one individual. What are the ERM strengths and weaknesses of this strategy?

Assignmentnbspon information systems audit and

Assignment  on Information Systems audit and controls  Assignment purpose: Elaborate on the different types of control that are applied in a hospital (Preventive, detective and corrective control). Evaluate the logical a ...

Analyze the time complexity of the following ternary search

Analyze the time complexity of the following ternary search algorithm: identify two points that subdivide a sorted array into three parts. If the given number is equal to one of these two points, we are done. Otherwise, ...

  • 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