Computer Science II - Juniata College



Software Models and User Interfaces 2/25/19 (100 points)Name _____________________________True/False on syntactic features of the C# language.[10 pts]__F___ C# has multiple inheritance.__ T ___ Strings are immutable in C# like in Java, but StringBuilder objects allow mutations of large strings with creating new strings.__ T ___ Strings can be compared like integers with < and == in C#.__ T ___ The verbatim string (@) permits multiple lines and special characters in a quoted string __ F ___ C# treats primitives (int, char, Boolean) differently as objects like Java.__ T ___ C# can automatically format the current time and date according to the locality of the development environment.__ T ___ The overloading of arithmetic operators and indexing [ ] can be applied to user-defined classes.__ F ___ Parameter passing is call-by-value only.__ T ___ ToString(string x) treats x as formatting string that controls how the object is to be converted to a string.__ F ___ The tryParse methods on strings have to be used in conjunction with exception handling for numeric input.GUI widgets.[8 pts]Name 3 GUI widgets that can be used for input: textbox, button, checkbox, updown…..Name 3 different GUI widgets that can be used for output: label, textbox, status lineMouse click positions in a frame use what two properties to track the position? _X____ and __Y___Other advanced [C#] programming concepts. Short answer. [20 pts]When do we need to serialize a C# object? [4]When we need to save the object for future… persistenceHow do you designate a class to be serializable? [2][Serializable]How do you then serialize an object to a file? [4]create a file that is designated binary or xml. Use a wrapper to transform the object writing it to the fileWhat two forms of files can be created when using serialization? [2]binary or xml What is the intent of the params type[] type of parameter? How is it used? [4]to pass variable numbers of parameters. Can then be treated as an array in the methodSketch the definition of a C# object property definition for an instance variable year that will hold an integer representing the year. If the value being set is less than 100 (someone is passing in a two digit year), add 2000 to the value. Otherwise treat the value as the full year. The getter doesn’t need to check or transform anything. Perfect C# syntax isn’t required. [4]public int year { get { return Year; } //read access set //write access { if ( value <100 ) Year = 2000 + value; else Year = value; } }Consider the Input-Process-Output (IPO) versus Event Driven (ED) / GUI program models. [22 pts]If you are conducting a survey for which all questions must be answered in order but the responses are free form, explain why the IPO approach is reasonable. [5]This is essentially a very synchronized situation and thus prompting, input, process cycle works effectively.If the survey questions can be answered out of order and require numeric and limited choices, why is an event driven/GUI approach more reasonable? [5]A GUI allows users to select questions and based on their choice, a widget can be presented that permits only the domain of values to be entered.Presuming survey results are appended to a CSV file and you want to regularly produce a standard report, which model would you choose and why? [5]IPO. There’s little interactionDraw a use case and activity chart for the scenario described in parts b and c. [7] 648935355294100501352745593000370840053276400259830553836500 Draw a Data-Flow Diagram for a GPS map display and log system for a public transportation vehicle. Assume this system, every second, takes a GPS location reading (latitude and longitude), updates a map display on the dashboard, and records the position and time to a log file. Recall that input is shown as a , output is a , storage is and a process is Connecting lines are labeled with data. There may be multiple process in an application.[12 pts]Statecharts. [16 pts]404004311095200Assume there are 3 global state variables:- State variable A tracks the highest or outermost level. What states are those? ___7, 4, 8______State variable B tracks the state chart in state 7. What states does B track?____1,2,3_______List all events modeled in the statechart:__a,b,c,d_______List all possible state combinations that would be considered when event b occurs:(7,2), [8 or (8,5) and (8,6)]Consider the starting event sequence, a,c,d,d,c. What is/are now the current state(s)? ____(7,1)______Final short answer.[12 pts]In MVC, explain what the Model is, what the View is, and what the Controller is. [9]Model – implementation of the tasks separated from its presentation. Should be limited in IOView – the presentation of the tasks to the user either by console or GUI or some other input/output modelController – layer of software that can provide the bridge between the model and view.When creating GUI application in Visual Studio using the drag and drop IDE for creating a form, you are not to edit a particular block of code in the forms class. Why? [3]This block of code is updated and maintained by the IDE. Changes here can corrupt or simply be replaced by any updates to the rapid development tools of the IDA ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download