EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Web作业代写
您的位置: 主页 > 编程案例 > Web作业代写 >
Web作业代做:编程英文留学生加急题目:Collection of news items for a news broadcast - Web作业代写
发布时间:2021-07-24 17:25:46浏览次数:
Within this task classes shall be practised using as example the collection of news items for a news broadcast. Correspondents contribute news items for the country they are in charge of.Each broadcast shall have a top news item, a number of further news items, a last minute one as well as the weather forecast at its end. For each news item the topic, the country and the duration shall be inputted and stored.At the end the schedule of a news broadcast shall be printed out.Subtask 1Define a class with nameDurationto store the duration of news items. The class shall have following members:a private integer attribute secondsa public standard constructor initialising the duration with value 00:00.a private constructor with one integer parameter for seconds initialising the attribute with this valuea public constructor with two integer parameters for minutes (mm) and seconds (ss) initialising the duration to value mm:ss (hint: one minute has 60 seconds).Furthermore the class shall have three friend operators:a public overloaded output operator for a reference to an object of this class. Always a duration shall be printed out with five characters in format mm:ss(minutes:seconds), e.g. 00:55, 01:30or 11:09.a public overloaded comparison operator =for two reference parameters of this class comparing two durations and returning trueor false.E.g. comparing durations 01:47 = 02:25valuetrueshall be returned, comparing 03:07 = 02:09value false.a public overloaded addition operator +for two parameters of this class adding the two durations and returning a resulting duration object.E.g. 01:47 + 02:25shall return a duration object with 04:12.Subtask 2Define a constant static object of type Durationwith name zerowith duration 00:00as well as a non constant static object with name standardwith duration 01:30(standard duration of a news item).Subtask 3Define a class with name Correspondentwith following members:a private attribute nameof type C++ string for the name of a correspondent.a private attribute countryof type C++ string for the country.a private static integer class constant maxCorrespondentswith value 200 (countries).a private static integer class variable numberOfCorrespondentswhich gets initialised (hint: outside of the class!) with 0.a private static array correspondentwith maxCorrespondentspointers to objects of this class as static class variable which all get initialised at compile time (hint: outside of the class!) with nullptr.a private constructor with two C++ strings as parameter to initialise the name and the country of the correspondent.a public static method with namenew_correspondentwith two C++ strings as parameter for the name and the country of a correspondent without return value. In the body a new object of this class shall be generated on the heap initialised by the name and the country, its address stored in the next free element of pointer array correspondentandnumberOfCorrespondentsshall be incremented by 1. If the array is completely full instead an error message shall be written.a public static method with name get_correspondentwith a C++ string as parameter for the country and a pointer to a correspondent as return value. In the body the correspondent shall be searched for in the static array correspondentand a pointer to her/him or a null pointer being returned.·a public overloaded output operator for a reference to an object of this class. In the body inside round brackets the country shall be outputted, following a minus sign and the name of the correspondent (see examples in screenshot below).Subtask 4For single news items define a class with name Itemwith following members:a private attribute with name durationof type Duration.a private attribute with name topicof type C++ string.a private pointer attribute with name correspondentof type Correspondent.a public standard constructor initialising the duration with above defined object zero, the topic with the empty string and the correspondent to a null pointer.a public constructor with a duration, a string and a pointer to a correspondent to initialise the three attributes.a public destructor.two public methods with name get_durationandget_topicwithout parameter returning a reference to each of the attributes.a public method with name get_correspondentwithout parameter returning a pointer to the correspondent.three public methods with namesset_duration, set_topicand set_correspondenteach with one parameter assigning the corresponding values of the attributes.a public method with name inputwithout parameter or return value. In the body the topic, the duration and the country shall be inputted from keyboard and these values assigned to the three attributes whereas the correspondent for the country shall be searched by calling static member functionget_correspondentfrom class Correspondent.a public overloaded output operator for a reference to an object of this class. In the body the duration shall be outputted, following sign+if it is longer than above defined objectstandard(use the comparison operator =defined for Duration), then a tabulator sign, the topic as well as output the objectcorrespondentis pointing to (see examples in screenshot below).Subtask 5For news define a class with nameNewswith following members:a private static constant integer attribute with name nwith value 3.a private attributewith name firstof type Item.a private attributewith name newsas an array ofnobjects of type Item.a private attributewith nameweatherof type Itemfor the weather forecast.a private pointer attributewith namelastMinuteof type Item.a public standard constructor with following functionality:After a user guidance send messageinputto object first.After a user guidance in a loop send messageinputto thenobjects in array news.Send object weathera message set_topicwith weather forecast as argument.Send object weathera message set_durationwith a two minuteDurationobject as argument.Assign a new object on heap of typeItemto pointer lastMinute.Send a messageset_topicwith argument end of the year is close to the objectlastMinutepoints to.Send a messageset_durationwith above defined objectstandardas argument to the objectlastMinutepoints to.a public methodprintwithout parameter or return value. In its body by using the output operator shall be written onto the standard character output stream: THE NEWS ,object first,in a loop all nobjects in array news,the object lastMinutepoints to as well asthe object weather.Add (in a loop) the single durations of all news items using above defined operator +(not directly the seconds but the objects of type Duration) and output the overall total duration of the news like shown in example below.Subtask 6Write a C++ function mainwith following definitions and statements:define a C++ string variable, successively as examples input three names of corresponents for France, Germanyand Great Britainand call new_correspondentfrom class Correspondentthree times respectively.Define an object with nameeveningof typeNewsfor the evening news (by the standard constructor all items are inputted).Send objecteveninga message print.

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。