编程代写:Systems Programming COMP2017

系统编程涉及设计和编写允许计算机硬件与程序员和用户交互的计算机程序,从而导致应用软件在计算机系统上的有效执行。典型的系统程序包括操作系统和固件、编译器、汇编器、I/O 例程、解释器、调度器、加载器和链接器等编程工具以及计算机编程语言的运行时库。

什么是Systems Programming

系统编程是任何计算机应用程序开发中必不可少的重要基础,并且总是不断发展以适应计算机硬件的变化。这种编程需要一定程度的硬件知识并且依赖于机器;因此,系统程序员必须知道软件需要在其上运行的预期硬件。

此外,程序员可能会对硬件和其他系统组件做出一些假设。该软件通常是用一种低级编程语言编写的,该语言能够在资源受限的环境中高效运行,并且使用小型库几乎没有运行时开销,或者根本没有。低级语言可以直接控制内存访问,并允许直接用汇编语言编写程序。大多数程序是使用汇编语言编写的,例如 C、C++ 和 C#。

系统编程导致了管理和控制计算机操作的计算机系统软件的开发。低级代码非常接近硬件级别,处理诸如寄存器和内存分配之类的事情。系统程序或系统软件协调各个组件之间的数据传输,并处理程序的编译、链接、启动和停止、从文件读取以及写入文件。

系统编程增强或扩展操作系统的功能并且可以包括诸如驱动程序、实用程序和更新的组件。它们能够有效管理硬件资源,如内存、文件访问、I/O 操作、设备管理和进程管理,如进程管理和多任务处理。一个例子是操作系统,它通常充当用户、应用软件和计算机硬件之间的接口。操作系统提供了一个环境,使用户能够有效地执行其他程序。操作系统由一组系统程序组成,其功能包括存储管理、文件处理、内存管理、CPU和设备调度与管理、错误处理、进程控制等。

为什么Systems Programming 很难学?

  • 系统编程是软件开发的一个重要方面,需要硬件规划和容量规划、软件系统升级、安装脚本、集成测试和系统范围的性能调整。这也是一项极具挑战性的任务。
  • 与可以使用高级算法编写漂亮代码的应用程序编程不同,系统编程要求程序员自己管理所有内容:从内存和设备、操作系统和生命周期、通信和集成——系统编程中缺乏抽象层使得编码变得极其困难。
  • 由于系统编程通常涉及较低抽象级别的编程,因此需要程序员对硬件和特定于平台的 API 有深入的了解,以便更直接地与它们交互。
  • 由于可用的编程工具有限,调试很困难;程序员需要熟练调试系统软件问题,并且需要熟练使用专门的调试工具来确定组件发生故障的位置,分析原因,并在可用的情况下应用补丁。
  • 程序员还需要安装和管理操作系统和最终用户应用程序之间的中间件,例如数据库管理系统和 Web 服务器。
  • 由于程序需要在资源受限的环境中运行,因此系统编程需要采用低级编程语言。
  • 由于系统编程充当高性能移动或 Web 应用程序的构建块,因此程序员必须不断努力提高系统软件的速度和性能,而这在编程设施和资源有限的情况下是很困难的。
  • 与有无数资源可用于提供编码帮助的应用程序编程相比,可用于系统编程的参考和资源是微不足道的。
  • 运行时库通常不可用;在这种情况下,它不是很强大并且不提供有效的错误检查

Systems Programming COMP2017 代考案例

Question 1

What is the difference between a C string and any char array?

  1. C string uses the last character to indicate the end of the string.
  2. char array does not store any quote characters
  3. C string is stored in static memory space
  4. no difference

Question 2

What is the value of the following code?

int c = “QUOKKA”[3];

char k[] = { 0, 98, 99, 98, 0 };

k[0] = c;

printf(“%s\n”, (char*)k);

  1. Kbcb
  2. No output. Segmentation Fault
  3. K
  4. Cannot compile

Question 3 Which of the following is valid C code syntax?

  • String str = “12345”;
  • int i = 0;
  • while ( i++ < str.length());
  • str = “12345”;
  • for (c in str):
  • continue;
  • char *str = “12345”;
  • while (*str++);
  • String str = “12345”;
  • int i = 0;
  • for (int i = 0; i < str.length();
  • ++i);
  • char *str = “12345”;
  • while (i++ && i < strlen(str); ) continue
  • None of these answers are correct.

Question 4

The following code implements an operation on a doubly linked list to add one element.

struct node {
31 struct node *next;
32 struct node *prev;
33 int* value;
34 };
35
36 // takes pointer to pointer to value and performs operations on value
37 void add_value(struct node** valuep , int* v){
38 //printf("addnull %d v %d"
39 if(valuep == NULL){
40 struct node **v = malloc(sizeof **v);
41 valuep = v;
42
43 }
44 if( (*valuep) == NULL ){
45 //printf("valuep null %d",*v);
46 // set new value
47
48 struct node *val = malloc(sizeof *val);
49 *valuep = val;
50 val -> next = NULL;
51 val -> prev = NULL;
52 val -> value = v;
53 }elseif((*valuep)->next==NULL){
54 //printf("valuep next null %d v %d\n",*(*valuep)->value ,*v);
55 struct node *val = malloc(sizeof *val);
56 (*valuep)->next = val;
57 val -> next = NULL;
58 val -> prev = *valuep;
59 val -> value = v;
60 //printf("valuep %d v %d\n",*(*valuep)->value , *v);
61 //printf("val %d v %d\n",*val->value , *v);
62 //ent -> values = value;
63 //add_value(ent, value);
64
65 }else{
66 add_value( &(*valuep)->next, v);
67 }
68
69 }

Questions

(a) Does the code compile without errors (Yes / No)? 4 marks

(i) If you answered YES, what is wrong with the function add value? annotate the code with brief

comments and arrows, circles etc.

(ii) If you answered NO, what syntax needs to be corrected to make the code compile? annotate the

code with brief comments and arrows, circles etc.

contact

Assignment Exmaple

Recent Case

Service Scope

C|C++|Java|Python|Matlab|Android|Jsp|Prolo
g|MIPS|Haskell|R|Linux|C#|PHP|SQL|.Net|Hand
oop|Processing|JS|Ruby|Scala|Rust|Data Mining|数据库|Oracle|Mysql|Sqlite|IOS|Data Mining|网络编程|多线程编程|Linux编程操作系统|计算机网络|留学生|编程|程序|代写|加急|个人代写|作业代写|Assignment

Wechat:maxxuezhang

wechat