首页 > 其他分享 >CE243 CSEE handling Task

CE243 CSEE handling Task

时间:2024-10-18 17:10:06浏览次数:1  
标签:CSEE Task shall text handling program file code your

School of Computer Science and Electronic Engineering (CSEE)1

CE243 (NWU) Assignment 1

  1. ObjectivesThis assignment aims to demonstrate your master of advanced C programming skills.
  1. The TaskYou shall write a C program to implement some text handling task. Your C program shall firstlyask for the name of the text file being inputted from the keyboard manually. Then, it shall open andread this text file. Finally, your C program shall analyse the text and output a meaningful answer tothe screen and also to a file for submission with your C program.Appendix 1 shows an example of the text file, which contains the following features:

 The provided file contains typed text in the form of English words, punctuation marks and Ckeywords, separated by space.

 The punctuation marks in the text file include the following four: comma (,), full stop (.),question mark (?), and exclamation mark (!).

 The number of C keywords in the text file is more than 1 and less than 32.At first, you shall create a header file (***.h) to include C keywords and 4 punctuation marks givenabove, which will be then included in your C program. Your C program shall read and analyse thetext file, and then produce a correct output with the following format:

 A line shall be output when your program reads either one of punctuation marks listed above orone of C keywords from the text file. Note that the punctuationmarks shall go with the textbeing read already, e.g.

Do these capabilities exist in most other languages?A keyword shall occupy one line itself, e.g.gotowhen a keyword is followed by a punctuation mark, they shall stay inone line, e.g.char, The total number of lines shall be counted and outputted as the last line with the prefix sentence

Total number of lines is: **”.

  1. Deadline and submission requirement The deadline for the electric submission of your Assignment 1 report and associated C program is

as given on the submission system (i.e., FASER, also note that it is GMT time). Please email yourassignment as ONE attachment to [email protected] prior to the above submissiondeadline. Please merge everything 代 写CE243  CSEE  handling Task listed below into one .doc or .pdf file and submit. The filenameshall take the following format:Surname_Firstname_RegistrationNumber_A1, all in English. Youremail subject shall use exactly the same format. No email content is necessary. In the meanwhileplease ALSO upload the same file to FASER.

 Your assignment report shall be written clearly, concise and easy to read.

 Write your name (both English and Chinese), registration number and the module code (CE243-NWU) clearly on the cover page, including a ToC (Table of Contents) (1 page). You shall use a flow chart to describe your software design and explain how it works using text

(1 or 2 pages). School of Computer Science and Electronic Engineering (CSEE)

 You shall test and run your code, collect the result and present the results in your written report

(1 or 2 pages).

 Print your C program at the end of the report (3 pages).

No extensions of the deadlines will be given. If, for any reason, you do not submit your code, therewill be no record of the submission time and you will automatically get a zero mark. You shallsubmit your work through the proper channel (electronic submission) and on time, even if it isincomplete - something is better than nothing.This assignment is to be completed individually, i.e. whatever you hand in must be your own

individual work. Any software or any other materials that you use in this assignment, whetherpreviously published or not, must be referred and properly acknowledged.

  1. Assessment

You will be assessed on the source code you submit. You are also expected to demonstrate itsperformance on another text file in Lab 5, to explain your code and answer questions about yourcode. Marks will be awarded for programming style, the number of features implemented (e.g., thepunctuation marks that can be detected by your program) as well as for your explanation of yourcode. Programs will be assessed as follows:Excellent (70 - 100%)

All features are implemented. The program is well-structured, commented and concise. Itorks correctly with all test data. Its output is correct, with meaningful statistics. Allquestions are answered correctly during your demonstration.Good (55 - 69%)

The program implements all of the required features, but has poor structure and comments. Itsoutput is partially correct. Not all questions are answered correctly during your demonstration.

Poor (40 - 54%)The program implements at least 50% of the required features. It has poor structure andcomments. The code executes but doesn’t work with all test data. Its output is partially correct.

At least half of the questions are answered correctly during your demonstration.

Awful (10 – 39%)The program can open and read a file, but has poor structure and comments. It doesn’t work

with all test data. Its output is incorrect. It does not produce any meaningful statistics. Most ofthe questions are not answered correctly during your demonstration.

Appendix 1The following text is for you to type into a text file, namely “assignment1.txt”.

C allows the programmer to write directly to memory unlike most of other programming languages.Key constructs in C such as pointers and arrays are designed to structure and manipulate memory in

a machine-independent fashion. Thirty two Keywords in C are also called as reserved words such aschar, int, float, goto and void. C gives control over the memory layout of data structures! Dynamic

memory allocation in C is under the control of the programmer unlike languages like Java and Perlthat shield the programmer from memory allocation and pointers. This can be useful since dealingwith memory allocation when building a high-level program is a highly error-prone process. C2School of Computer Science and Electronic Engineering (CSEE)provides a uniform interface when dealing with low-level code such as the part of the OS that

controls a device. Do these capabilities exist in most other languages? Answer is no.3

标签:CSEE,Task,shall,text,handling,program,file,code,your
From: https://www.cnblogs.com/goodlunn/p/18473987

相关文章

  • Datawhale 组队学习 文生图 Prompt攻防 task03随笔
    这期我们从不同角度切入探讨赛题的进阶思路思路1:对比不同大模型首先我们可以选择尝试不同的大模型,使用更复杂的大模型可以提高文本改写的质量和效果。随着模型大小的增加,其表示能力也随之增强,能够捕捉更细微的语言特征和语义信息。这意味着大型模型在理解和生成文本时可以更......
  • C#线程4---Task(任务并行库TPL)
     简介:   线程池的优势与不足:使用线程池可以使我们在减少并行度花销时节省操作系统资源。我们可以认为线程池是一个抽象层,其向程序员隐藏了使用线程的细节,使我们专心处理程序逻辑,而不是各种线程问题。但使用线程池也相当复杂。从线程池的工作者线程中获取结果并不容易。......
  • task.2
     ......
  • Stanford CS149 -- Assignment 2: Building A Task Execution Library from the Groun
    作业描述及代码参见:CS149-asst2PartAStep1只需要实现一个简单的任务系统,在run()的开始生成工作线程,并在run()返回之前从主线程合并这些线程。任务的分配方式采用动态分配,即每个线程每次取一个任务完成,能者多劳。每个线程的核心实现为:while(true){inttaskID=done+......
  • C++异步调用 future async promise packaged_task
    背景:C++异步调用是现代C++编程中的一种重要技术,它允许程序在等待某个任务完成时继续执行其他代码,从而提高程序的效率和响应性。C++11引入了std::async、std::future和std::promise等工具,使得异步编程变得更加方便和直观。以下是关于C++异步调用的详细介绍,包括基本概......
  • CF959F Mahmoud and Ehab and yet another xor task 题解
    题目传送门前置知识线性基解法将操作离线下来,并按\(\{l\}\)升序排序,接着顺序插入线性基并处理询问。对于未成功插入线性基的元素\(k\)一定能被线性基内选出若干元素得到。故在\(x\)能被表出的情况下,设\(1\siml\)中成功插入线性基的元素个数为\(siz\),对于剩下\(......
  • ansible中为什么不都是用shell模块写task,而是创建出一个一个的模块
    ansible的shell模块的功能非常强大,它甚至可以代替ansible的所有模块,比如像unarchive命令,在shell中可以分解为。通过scp命令传送包到远程,再通过tar命令对文件进行解压,再比如user模块可以直接在shell模块中调用useradd命令和usermod命令进行用户的管理,那么为什么还会有其他模......
  • 【内核】【转载】记一次Linux Hung Task分析过程
    vmcore-dmesg.txt截图如下,崩溃栈里面有我们产品的驱动,现在要分析出是不是我们导致的。系统崩溃是因为触发了hungtask检测条件,系统panic了。所谓hungtask,就是进程的状态为D状态,即TASK_UNINTERRUPTIBLE状态,短时间的D状态是正常的,长时间就会有问题了,可能系统IO有问题,也可能其他bug......
  • std::packaged_task<返回类型(参数类型)>
    std::packaged_task概述std::packaged_task是C++11引入的标准库模板类,用于包装一个可调用对象(如函数、lambda表达式、函数对象等),使其能够与std::future协同工作。简单来说,它将一个任务(可调用对象)包装起来,并允许你获取该任务的执行结果,这样你可以在一个线程中执行任务,并在......
  • `std::packaged_task`、`std::thread` 和 `std::async` 的区别与联系
    std::packaged_task、std::thread和std::async的区别与联系std::packaged_task、std::thread和std::async都是C++11中提供的并发工具,用于执行任务并处理多线程操作。虽然它们都有类似的作用(并发执行任务),但在功能和使用方式上有显著区别。下面分别解释它们的特点,并说明它......