[SOLVED] 代写 • In this assignment, you will write a program that sorts text files formatted like the file assignment25.txt, attached below.

30 $

File Name: 代写_• In_this_assignment,_you_will_write_a_program_that_sorts_text_files_formatted_like_the_file_assignment25.txt,_attached_below..zip
File Size: 1271.7 KB

SKU: 8966127791 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


•In this assignment, you will write a program that sorts text files formatted like the file assignment25.txt, attached below.
•In the file: English and Japanese versions of the same word are separated by a tab (‘t’); one word per-line.
•You will be sorting by the English words. In sorting them, disregard case – a capital letter is considered the same as the corresponding lowercase letter. Also, disregard anything enclosed in brackets at the beginning of a line, anything enclosed in parentheses at the beginning of a line, and disregard spaces at the beginning of a line (see Instructions).
•You may use the attached starter code for your assignment: A25StarterCode.cpp
•Download it to your computer and change the name of the file.
•Change the comments as appropriate.

Instructions:
•Use commandline input to input the filename.
•For example, the UNIX command is: ./a.out assignment25.txt
•In your program, argv[1] will contain the filename.
•Use the ifstream class for file input.
•Read one line at a time from the input file.
•Break the line into three parts: the original English part,the original Japanese part, and the sort field.
•The English and Japanese words are divided by a tab (“t”).
•To split the English and Japanese parts, find the character position of the tab.
•Take a substring of the first part up to the tab for the English part
•Take a substring of the second part of each line for the Japanese part.
•Store these in two separate variables.
•Store the sort field in a third variable.
•The sort field is equivalent to the English part with a few changes:
•Change all of the capitalized English characters to lowercase letters.
•Remove any characters enclosed in brackets in front of any words.
•Remove any characters enclosed in parentheses in front of any words.
•Remove the space in front of any words.
•Define a class Entry which has three strings as data members: the English, the Japanese, and the sort field.
•You need a default constructor (a constructor with no parameters) for Entry.
•You need three set functions and three get functions for the three data members (strings english, japanese, and sortfield).
•Overload the Entry “less than” operator: operator<•This will be used to sort Entry objects.•The less than operator should compare the sortfield of two Entry objects.•The first line of the operator<() function definition should be:bool operator< (const Entry e) const{•The code inside the function definition should be: If the sortfield of this object is less than the sortfield of the parameter, then return true. Otherwise, return false.•Make a vector of Entry objects.•Read the data from the file one line at a time, break the line into three parts as described above, and store the data for each line in an Entry object.•Store each Entry object in the vector.•Sort the vector of Entry objects.•Display the English and Japanese parts of the sorted Entry objects to the screen.•The text in the output should be the same as the text in the input file, but it will be sorted in the English word order and aligned in two columns.•The lines in the output should form two columns, with the first letter of each word lining up with all the other words.•To display Entry objects, you can write a friend function to overload operator<< (so you can use cout), or you may use the get() functions to access the English and Japanese words.•Use the field width and left justification to make columns.•See the example output below for details.Example:./a.outassignment25.txtA.M.gozen about (time)-koro -goroabout ~ [Not used for time.]-kurai -gurai absent(o)yasumi (be) absent (from ~)(-o) yasumimasu address juusho after (not time)(-no) ato de after (time)-sugi again mata airplanehikooki all right daijoobu already moo (+aff.) alwaysitsumo amdesu America amerika amuse [not used for sports & music] asobimasu (Noun1) and (Noun2), etc. (N1) ya (N2) and [only at beginning of sentence] soshite and [used between two nouns]to And thensorekara (not) anythingnanimo+Neg.(not to) anywhere dokoemo+Neg. April shigatsu are desu art bijutsu at (location)[with existence verb]ni at (place) [with action verb] de [with action verb]at (specific time)(specific time) ni [with existence verb](not) at all zenzen+Neg. Augusthachigatsu auntobasan autumnaki bad warui bag baggu ball point penboorupen balloon fuusen baseballyakyuu basketballbasuketto(booru) bathroom(o)toire, (o)tearai beach umi beard hige beautiful utsukushii because (reason) kara,(result) bed beddo beforemae before (not time) (-no) mae ni before (time) -mae -begin hajimemasu Besides [at beginning of a sentence]soreni bicycle jitensha big ookii birdtori birthday(o)tanjoobi (is) blackkuroi black kuro (is) blue aoi blueao boatfune bodykarada bookhon bookstore honya boringtsumaranai born in (month) -gatsu umare -bow rei bowlful -pai -box lunch bentoo boy otoko no ko bread pan (a) break yasumijikan breakfast asagohan (is) brownchairoi brown chairo buildingtatemono bus basu busyisogashii But [at beginning of a sentence.] demo but [less formal than demo] (sentence 1) ga, (sentence 2)buy kaimasu by (tool) (tool) de by (transportation facility)(transportation) de cafeteria kafeteria camerakamera campkyanpu can do well tokui can hearkikoemasu can see miemasu candy ame, kyandii cannot hear kikoemasen cannot seemiemasen cap booshi car kuruma, jidoosha (playing) cards toranpu cat neko cent(s) -sento -chair isu cheap yasui child kodomo China chuugoku Chinese languagechuugokugo chocolate chokoreeto chopsticks(o) hashi (class jugyoo, kurasu classroom kyooshitsu clean kirei clock tokei (to) closeshimemasu close, near chikai (Please) close. shimete kudasai cockroach gokiburi coffeekoohii coffee shop kissaten colakoora (a) coldkaze (is) cold samui (is) cold (to the touch)tsumetai college daigaku college student daigakusei color iro comekimasu company kaisha company employeekaishain computerkonpyuutaa concert konsaato Congratulations.omedetoo gozaimasu. cool [temperature]suzushii cousinitoko cup koppu cupful-pai -cutekawaii dance dansu

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 代写 • In this assignment, you will write a program that sorts text files formatted like the file assignment25.txt, attached below.
30 $