当前位置:首页 > 综合资讯 > 正文

代写CSE 325编程、代做program留学生编程

09-26 综合资讯 CSE 325旅宝网


CSE 325 Fall 2019

Computer Project #4

Assignment Overview

For this assignment, you are to design and implement a C/C++ program that will serve as a basic command-line

interpreter (shell). You will design and implement additional functionality in subsequent projects.

It is worth 40 points (4% of course grade) and must be completed no later than 11:59 PM on Thursday, 9/26.

Assignment Deliverables

The deliverables for this assignment are the following files:

proj04.makefile – the makefile which produces proj04

proj04.student.c – the source code file for your solution

Be sure to use the specified file names and to submit your files for grading via the CSE Handin system before the

project deadline.

Assignment Specifications

1. The program will repeatedly display a prompt containing the sequence number of the current command

(starting at 1) and the username of the user executing the program. This information will be enclosed in the

characters '[' and ']'. For example:

[1 mccullen]

The sequence number and username will be separated by a single space.

2. After displaying the prompt, the program will repeatedly read one line of input from the user and process it. An

input line is defined as a sequence of zero or more tokens (character strings), separated by one or more delimiters

(blanks and tabs), ending with a newline character. There will be no more than 128 characters in a line.

If the first token is the name of a built-in command (listed below), then the program will take the appropriate

action. Otherwise, the program will assume that it is an error.

3. The program will recognize the following built-in commands:

halt terminate the shell process

help display built-in commands

date display current date and time

env display environment variables

path display current search path

cwd display absolute pathname of current working directory

cd manage current working directory

Built-in commands will be completely processed by the program (the program will not create a child process to

perform the processing).

4. The command "help" will display a list of all valid built-in commands. 

5. The command "date" will display the current date and time in a human-readable format.

6. The command "env" will display the user’s environment variables in a format similar to "setenv" in the C shell.

7. The command "path" will display the current search path in a readable format.

8. The command "cwd" will display the absolute pathname of the current working directory.

9. The command "cd" will manage the current working directory.

a) The command "cd" without any other tokens will reset the current working directory to be the user’s home

directory.

b) The command "cd DIR" will reset the current working directory to be "DIR", where that token may be a

relative or absolute pathname.

c) The command "cd ~USER" will reset the current working directory to be the home directory of the user

with username USER. As a special case, the symbol "~" represents the home directory of the current user.

10. The program will perform appropriate error handling. It will display an appropriate message if the user's

command fails in any way.

Assignment Notes

1. As stated above, your source code file will be named “proj04.student.c”; that source code file may contain C or

C++ statements.

2. You must use “g++” to translate your source code file in the CSE Linux environment.

3. Information about system calls and library functions which might be useful for this project may be viewed using

the "man" utility. For example:

man 2 time

man 2 chdir

man 3 ctime

man 3 getcwd

man 3 cuserid

man 3 string

4. As noted above, you will extend your program in subsequent projects, so you would be wise to properly

structure and comment your source code. 

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱:99515681@qq.com

微信:codehelp



网站介绍旅宝网
旅宝网(news.lvbol.com)提供最齐全的国内外旅游景点大全,您可以在这里找到关于旅游目的地最详细的图文介绍,可信赖的游览路线,景区的卫星地图及出行提示,与大家分享自己的旅行心得感受。
  • 文章总数
  • 27379访问次数
  • 建站天数