Computer Science II



Software Models and User Interfaces 2/25/19 (100 points)Name _____________________________True/False on syntactic features of the C# language.[10 pts]______ C# has multiple inheritance.______ Strings are immutable in C# like in Java, but StringBuilder objects allow mutations of large strings with creating new strings.______ Strings can be compared like integers with < and == in C#.______ The verbatim string (@) permits multiple lines and special characters in a quoted string ______ C# treats primitives (int, char, Boolean) differently as objects like Java.______ C# can automatically format the current time and date according to the locality of the development environment.______ The overloading of arithmetic operators and indexing [ ] can be applied to user-defined classes.______ Parameter passing is call-by-value only.______ ToString(string x) treats x as formatting string that controls how the object is to be converted to a string.______ 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: ____________. ____________. ______________Name 3 different GUI widgets that can be used for output: _____________. ____________. __________Mouse click positions in a frame use what two properties to track the position? ______ and ______Other advanced [C#] programming concepts. Short answer. [20 pts]When do we need to serialize a C# object? [4]How do you designate a class to be serializable? [2]How do you then serialize an object to a file? [4]What two forms of files can be created when using serialization? [2] What is the intent of the params type[] type of parameter? How is it used? [4]Sketch 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]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]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]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]Draw 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? _________________State variable B tracks the state chart in state 7. What states does B track?___________________List all events modeled in the statechart:_____________________List all possible state combinations that would be considered when event b occurs:Consider the starting event sequence, a,c,d,d,c. What is/are now the current state(s)? ________________Final short answer.[12 pts]In MVC, explain what the Model is, what the View is, and what the Controller is. [9]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] ................
................

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

Google Online Preview   Download