Starting from:

$29.99

CSC3320 Lab 6 - Part 2 - Post Lab Solution

Purpose: Learn the differences between writing a Bourne shell script and Java program. Learn how to use command argument in a Bourne Shell script. Learn how to compile and run Java and C programs in Unix terminal.
Part A:
Please complete the tasks in following table step by step and finish the questions below the table.

Note: when typing the shell script in your terminal, please be very careful of the spaces.
Questions:
1) Attach a screenshot of the output in step 4.
2) Describe what does the shell script foo.sh do?
Part B:

Question:
Attach a screenshot of the output.
Part C:

Question:
Attach a screenshot of the output.
Part D:
Write a Java program named foo.java to accomplish the same task as that in foo.sh of Part A.

Question:
Then put the source code of foo.java in your answer sheet.
Part E:
Create and run Kernighan and Ritchie’s famous “hello,world” program. Step 1: Go to your home directory (cd ~) and create a new file named as hello.c (vi hello.c

Questions:
1) Attach a screenshot of the output in step 4.
2) Try following command to compile and link hello.c again. And tell what new file is generated after this command? $cc -o hello hello.c
3) Try the command below and attach a screenshot of the output.$./hello
4) Now write a new C program named as myName.c based on hello.c. In this program, print out your first name and last name instead of “Hello,world”. For example, the output could be “My name is Yuan Long”.
Execute your myName.c and attach a screenshot of the output. Then write the source code
of myName.c in your answer sheet and upload your file myName.c to classroom.


More products