subject

Your expensive, closed source, text editor is taking up too much resources on your computer. You have set out to create a free, light weight text editor that does all the tasks you require. The text editor will support only a few functions. Your functions will be one of the following

Command Type

Type Space

Command Format

SPACE

Notes

Adds a space character to the end of the character buffer

Back Space

BACK

Deletes the last character in the character buffer. If there are no valid characters to delete the command does nothing.

Type Character

TYPE

Adds a non-whitespace character to the end of the character buffer

Flip

FLIP

Flips the contents of the character buffer. The back becomes the front and vice versa. The command will always flip, even if the buffer is empty.

Undo

UNDO

Undos the last BACK, TYPE, SPACE, FLIP, or REDO command, that has not already been undone. If there are no valid commands to undo the command does nothing.

Redo

REDO

Undos the last effective UNDO command, provided there were no effective BACK, TYPE, SPACE, or FLIP commands following it. If there are no valid commands to undo the command does nothing.

Print

PRINT

Prints the contents of the end of the character buffer up until the last space or the end of the buffer. This command does not effect the REDO and UNDO commands.

Exit

EXIT

The program stops execution

You will make a program that takes in a series of commands and performs the requested print operations.

Input Specification

The input will consist of commands each on their own line. There will be exactly one EXIT command, and the EXIT command is guaranteed to be the last given command. For this problem you can assume that non-white space characters will be upper and lower case letters and digits ‘0’ through ‘9’.

Output Specification

For each given print command print the contents of the buffer at the given time on its own separate line. If there is no characters in the buffer or the last character in the buffer is a space, print the text "No word found." on its own line, quotes for clarity. You are guaranteed that the total number of characters printed by the commands will be less than 2,000,000.

in C. Your expensive, closed source, text editor is taking up too much resources on your computer. You have set out to create a free, light weight text editor that does all the tasks you require. The text editor will support only a few functions. Your functions will be one of the following

Command Type

Type Space

Command Format

SPACE

Notes

Adds a space character to the end of the character buffer

Back Space
BACK
Deletes the last character in the character buffer. If there are no valid characters to delete the command does nothing.
Type Character
TYPE
Adds a non-whitespace character to the end of the character buffer
Flip
FLIP
Flips the contents of the character buffer. The back becomes the front and vice versa. The command will always flip, even if the buffer is empty.
Undo
UNDO
Undos the last BACK, TYPE, SPACE, FLIP, or REDO command, that has not already been undone. If there are no valid commands to undo the command does nothing.
Redo
REDO
Undos the last effective UNDO command, provided there were no effective BACK, TYPE, SPACE, or FLIP commands following it. If there are no valid commands to undo the command does nothing.
Print
PRINT
Prints the contents of the end of the character buffer up until the last space or the end of the buffer. This command does not effect the REDO and UNDO commands.

Exit

EXIT

The program stops execution

You will make a program that takes in a series of commands and performs the requested print operations.

Input Specification

The input will consist of commands each on their own line. There will be exactly one EXIT command, and the EXIT command is guaranteed to be the last given command. For this problem you can assume that non-white space characters will be upper and lower case letters and digits ‘0’ through ‘9’.

Output Specification

For each given print command print the contents of the buffer at the given time on its own separate line. If there is no characters in the buffer or the last character in the buffer is a space, print the text "No word found." on its own line, quotes for clarity. You are guaranteed that the total number of characters printed by the commands will be less than 2,000,000.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:00, alexabessin
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 3
image
Computers and Technology, 22.06.2019 11:00, simbupls
Technician a says that the radiator usually cools better if the front air dam is removed. technician b says that when a condenser has a leak it can be repaired easily with epoxy. who is correct?
Answers: 1
image
Computers and Technology, 22.06.2019 13:10, LuckyCharms988
Calculating the "total price" of an item is tedious, so implement a get_item_cost method that just returns the quantity times the price for an item. by the way, the technical term for this kind of instance method is an accessor method, but you'll hear developers calling them getters because they always start with "get" and they get some value from instance attributes. in order to make the items sortable by their total total price, we need to customize our class. search the lectures slides for "magic" to see how to do this. see section 9.8 for an additional reference. the receipt class: this will be the class that defines our receipt type. obviously, a receipt will consist of the items on the receipt. this is called the composition design pattern. and it is very powerful. instance attributes: customer_name : it is very important to always know everything you can about your customers for "analytics", so you will keep track of a string customer name in objects of type receipt. date : the legal team has required that you keep track of the dates that purchases happen for "legal reasons", so you will also keep track of the string date in objects of type receipt. cart_items : this will be a list of the items in the cart and hence end up on the receipt. methods: 1. create a default constructor that can take a customer name as an argument, but if it gets no customer name, it will just put "real human" for the customer_name attribute. it should also accept a date argument, but will just use the value "today" for the date instance attribute if no date is given. the parameters should be named the same as the instance attributes to keep things simple. 2. add_item : self-descriptive. takes a parameter which we hope beyond hope is of type itemtopurchase and adds it to the cart_items. returns none. 3. print_receipt : takes a single parameter isevil, with default value true. returns a total cost of all the items on the receipt (remember to factor in the quantity). prints the receipt based on the following specification: for example, if isevil is true, and customer_name and date are the default values: welcome to evilmart, real human today have an evil day! otherwise, it should print: welcome to goodgo, real human today have an good day! then the receipt should be printed in sorted order like we discussed earlier, but whether or not it starts with the highest cost (think reverse), depends on the value of isevil. if it is evil, then the lowest cost items should print first, but if it is good, then it will print the highest cost items first. (cost meaning price*quantity). remember to return the total cost regardless! your main() function: the main flow of control of your program should go in a main() function or the program will fail all the unit tests. get the name of the customer with the prompt: enter customer name: get the date with the prompt: enter today's date then, ask the question: are you evil? your program should consider the following as true: yeah yup let's face it: yes hint: what do these strings all have in common? your program should consider all the following as false: no nah perhaps but i'm leaning no (just be glad you don't have to handle "yeah no.") okay enough horsing around. (get it? aggies? ! horsing! ) next, in the main() function, you will have to create a receipt object and start adding things into it using an input-while loop. the loop will prompt the user for the item name exactly as in the previous zylab (9.11). but unlike the previous zylab, the loop will terminate only if an empty string is entered for the item name. then, the price and the quantity will be prompted for exactly as in the previous zylab. create the itemtopurchase objects in the same manner as the previous zylab, but don't forget to add them to the receipt using your add_item instance method. then, the items on the receipt should be printed with the same formatting as in the previous zylab, of course with either "good" or "evil" ordering. however, on the last line, the total should be printed as follows: where 10 is replaced by the actual total. sample run here is what a sample run of the final program should look like: enter customer name: nate enter today's date: 12/20/2019 are you evil? bwahahahaha yes enter the item name: bottled student tears enter the item price: 2 enter the item quantity: 299 enter the item name: salt enter the item price: 2 enter the item quantity: 1 enter the item name: welcome to evilmart, nate 12/20/2019 have an evil day! salt 1 @ $2 = $2 bottled student tears 299 @ $2 = $598 total: $600
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, woodpeckerdeejpe8wvh
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
You know the right answer?
Your expensive, closed source, text editor is taking up too much resources on your computer. You hav...

Questions in other subjects:

Konu
Mathematics, 14.12.2019 22:31