我可以制作一个新文件,但我不能写它 [英] I can make a new file but i cant write on it

查看:45
本文介绍了我可以制作一个新文件,但我不能写它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发一个简单的文本编辑器程序。该程序将向用户显示一个选项菜单,并将根据他的选择进行操作。使用功能分解将系统分解为主程序访问的小功能,以提供系统功能。使用文本编辑器,用户可以:

?输入文件名

?程序将检查是否存在具有此名称的文件。如果是,它会告诉用户?这个文件已经存在?如果没有,它会创建一个具有此名称的新文件并告诉用户?这是一个新文件。我是为你创造的?
?然后显示一个选项菜单,程序接受用户的选择并执行它并循环,直到输入退出选项。可能的选择是:

1.在文件末尾添加新文本

2.显示文件内容

3。清空文件

4.加密文件内容

5.解密文件内容

6.合并另一个文件

7.计算文件中的单词数。

8.计算文件中的字符数

9.在文件中搜索单词

10.将文件内容改为大写。

11.退出


这些功能的解释如下:

1-添加内容功能将打开文件以便以附加模式写入(这意味着文件的原始内容不会丢失,但新的写入将被添加到文件的末尾)和将允许用户键入存储在文件中的文本,直到他按下EOF字符(Ctrl + z)结束写入并将用户返回菜单。

2-显示内容功能向用户显示当前文件内容并将其返回菜单。

3-清空文件清除文件并删除其内容并返回到主菜单。

4-加密文件内容将重写文件内容但移动了一个ASCII字符,即每个字符将被ASCII表中跟随它的字符替换。操作后重新显示菜单。例如,以下文件:



我无法理解这个菜单是如何工作的:S

谢谢

Develop a simple text editor program. The program will show the user a menu of choices and will act according to his choice. Use functional decomposition to break the system into small functions that are accessed by the main program to provide the system functionality. Using the text editor, the user can:
? Input the name of a file
? The program will check if a file with this name exists or not. If yes, it will tell the user ?This File Already Exists? and if not it creates a new file with this name and tell the user ?This is a new file. I created it for you ?.
? Then a menu of choices is displayed and the program takes the user?s choice and executes it and loops until the exit choice is entered. The possible choices are:
1. Add new text to the end of the file
2. Display the content of the file
3. Empty the file
4. Encrypt the file content
5. Decrypt the file content
6. Merge another file
7. Count the number of words in the file.
8. Count the number of characters in the file
9. Search for a word in the file
10. Turn the file content to upper case.
11. Exit

The explanation of each of these functionalities is as follows:
1- Adding content functionality will open the file for writing in append mode (which means that the original content of the file is not lost but new the writing will be added to the end of the file) and will allow the user to type in text that is stored in the file, until he presses EOF character (Ctrl+z) which ends the writing and returns the user to the menu.
2- Display content functionality displays the current file content to the user and returns him to the menu.
3- Empty the file clears the file and erases its content and returns to the main menu.
4- Encrypt the file content will re-write the file content but shifted one ASCII character, i.e., each character will be replaced by the character following it in the ASCII table. The menu is re-displayed after the operation. For example, the following file:



I cant understand how this menu works :S
Thanks

推荐答案

本网站的专家非常乐意帮助您解决问题,但他们无法为您完成任务/计划。首先尝试自己的作业/计划并发布有关您遇到的任何困难或有关您不知道如何实现的特定代码功能的问题。


请阅读< a href =http://www.thescripts.com/forum/faq.php?faq=posting_guidelines\"target =_ blank>发布指南,特别是课程作业发布指南


然后当你准备发布一个新的这个帖子中的问题。


MODERATOR
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don''t know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

Then when you are ready post a new question in this thread.

MODERATOR


考虑到这一点,您的具体问题是什么?如果你说你不明白菜单是如何工作的,那么你需要和你的老师谈谈以澄清它。
With that in mind, what is your specific problem? If you say you do not understand how the menu works, then you need to go talk to your teacher to get it clarified.


谢谢:)我读了指南线

1st ..i试图做这个程序

i成功执行了新文件的创建并在上面写了我知道代码..

i不知道怎么做这个菜单应该完成..

以及如何搜索文件中的单词..


我的时间框架是4天。 。

感谢您的帮助:)
Thanks :) i read the guide lines
1st ..i attempted to do the program
i successfully executed the creating of the new file and writing on it cos i kno the codes..
i dont know how this menu is supposed to be done..
and how to search for a word in the file..

my time frame is th nxt 4 days..
Thanks for ur help :)


这篇关于我可以制作一个新文件,但我不能写它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆