{"id":78180,"date":"2021-12-01T05:33:59","date_gmt":"2021-12-01T05:33:59","guid":{"rendered":"https:\/\/papersspot.com\/blog\/2021\/12\/01\/btm-380-assignment-2-in-this-assignment-you-are-asked-to\/"},"modified":"2021-12-01T05:33:59","modified_gmt":"2021-12-01T05:33:59","slug":"btm-380-assignment-2-in-this-assignment-you-are-asked-to","status":"publish","type":"post","link":"https:\/\/papersspot.com\/blog\/2021\/12\/01\/btm-380-assignment-2-in-this-assignment-you-are-asked-to\/","title":{"rendered":"BTM 380 Assignment # 2 In this assignment you are asked to"},"content":{"rendered":"<p>BTM 380<\/p>\n<p> Assignment # 2<\/p>\n<p> In this assignment you are asked to build a simple application to keep track of car inventory. You should build a \u201cCar\u201d class with the following private fields: model (string), year (int), color (string), and mileage (double). Provide properties in order to access these fields. Provide a constructor with parameters that can be used to populate all of the fields. Provide GetInfo() method that returns a string consisting of a model, year, color, and mileage, appropriately formatted. Also, provide a \u201cCarDM\u201d (DM stands for data management) class that features two static methods: save(List), and load(). The first one should accept a list of car objects and save their field values to a file called \u201ccarlist.txt\u201d. The second one should read the \u201ccarlist.txt\u201d file and generate (and return) a list of \u201ccar\u201d type objects populating their fields with values read from the file. The file should look like follows:<\/p>\n<p> As a result of reading this file (as an example), a list of two car objects would be generated: one for Blue Accord, 2016 with 0 mileage; and the second one for White Passat, 2014 with the mileage of 20000. <\/p>\n<p> Your main form should look like this:<\/p>\n<p> When it loads, the list of car objects should be created by reading from the above file. When Add Car button is clicked the following screen should appear:<\/p>\n<p> When the user fills out new car information and clicks \u201cAdd\u201d, the new car object is created, the form is closed, so that the main form is shown again, and the newly created car object is added to the list of cars. When \u201cView cars\u201d button is clicked, the following form shows, displaying all car objects currently in the list (use GetInfo() function here. You will also have to send the list of cars from the main form to tis form. To do this in the view form have a public variable for list of cars, and assign to it the list of cars from the main form).<\/p>\n<p> When \u201cSave button is clicked the current list of cars should be stored in the file \u201ccarlist.txt\u201d.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>BTM 380 Assignment # 2 In this assignment you are asked to build a simple application to keep track of car inventory. You should build a \u201cCar\u201d class with the following private fields: model (string), year (int), color (string), and mileage (double). Provide properties in order to access these fields. Provide a constructor with parameters [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10],"class_list":["post-78180","post","type-post","status-publish","format-standard","hentry","category-research-paper-writing","tag-writing"],"_links":{"self":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/78180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/comments?post=78180"}],"version-history":[{"count":0,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/posts\/78180\/revisions"}],"wp:attachment":[{"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/media?parent=78180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/categories?post=78180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/papersspot.com\/blog\/wp-json\/wp\/v2\/tags?post=78180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}