CSIS 1624 CLASS TEST 6

Similar documents
CALCULATOR APPLICATION

Object oriented lab /second year / review/lecturer: yasmin maki

The Open Core Interface SDK has to be installed on your development computer. The SDK can be downloaded at:

Class Test 4. Question 1. Use notepad to create a console application that displays a stick figure. See figure 1. Question 2

Main Game Code. //ok honestly im not sure, if i guess its a class ment for this page called methodtimer that //either uses the timer or set to timer..

You can call the project anything you like I will be calling this one project slide show.

if (say==0) { k.commandtext = "Insert into kullanici(k_adi,sifre) values('" + textbox3.text + "','" + textbox4.text + "')"; k.

Mainly three tables namely Teacher, Student and Class for small database of a school. are used. The snapshots of all three tables are shown below.

IBSDK Quick Start Tutorial for C# 2010

Now find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]

Start Visual Studio and create a new windows form application under C# programming language. Call this project YouTube Alarm Clock.

Click on the empty form and apply the following options to the properties Windows.

Form Properties Window

// Specify SEF file to load. oschema = (edischema) oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

First start a new Windows Form Application from C# and name it Interest Calculator. We need 3 text boxes. 4 labels. 1 button

Representing Recursive Relationships Using REP++ TreeView

Experiment 5 : Creating a Windows application to interface with 7-Segment LED display

To start we will be using visual studio Start a new C# windows form application project and name it motivational quotes viewer

Start Visual Studio, create a new project called Helicopter Game and press OK

We are going to use some graphics and found a nice little batman running GIF, off course you can use any image you want for the project.

Visual Basic/C# Programming (330)

Start Visual Studio, start a new Windows Form project under the C# language, name the project BalloonPop MooICT and click OK.

Visual Basic/C# Programming (330)

create database ABCD use ABCD create table bolumler ( bolumkodu int primary key, bolumadi varchar(20) )

// Precondition: None // Postcondition: The address' name has been set to the // specified value set;

This is an open-book test. You may use the text book Be Sharp with C# but no other sources, written or electronic, will be allowed.

} } public void getir() { DataTable dt = vt.dtgetir("select* from stok order by stokadi");

C# winforms gridview

Huw Talliss Data Structures and Variables. Variables

เว บแอพล เคช น. private void Back_Click(object sender, EventArgs e) { this.webbrowser2.goback(); }

Create your own Meme Maker in C#

Brian Kiser November Vigilant C# 2.5. Commonwealth of Kentucky Frankfort, Kentucky

This is the empty form we will be working with in this game. Look under the properties window and find the following and change them.

// Program 2 - Extra Credit // CIS // Spring // Due: 3/11/2015. // By: Andrew L. Wright. //Edited by : Ben Spalding

UNIT-3. Prepared by R.VINODINI 1

RegEx - Numbers matching. Below is a sample code to find the existence of integers within a string.

// Specify SEF file to load. edischema oschema = oedidoc.loadschema(spath + sseffilename, SchemaTypeIDConstants. Schema_Standard_Exchange_Format);

Writing Your First Autodesk Revit Model Review Plug-In

FDSc in ICT. Building a Program in C#

string spath; string sedifile = "277_005010X228.X12"; string sseffile = "277_005010X228.SemRef.EVAL0.SEF";

بسم هللا الرحمن الرحيم المحاضرة السابعة مستوى ثالث علوم حاسوب برمجة مرئية 2 )عملي ) جامعة الجزيرة محافظة اب الجمهورية اليمنية النافذة الرئيسية

CSC Java Programming, Fall Java Data Types and Control Constructs

Classes in C# namespace classtest { public class myclass { public myclass() { } } }

XNA 4.0 RPG Tutorials. Part 11b. Game Editors

UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER:

Eyes of the Dragon - XNA Part 37 Map Editor Revisited

Using Template Bookmarks for Automating Microsoft Word Reports

namespace csharp_gen277x214 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Tutorial 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and Arithmetic

Quick Guide for the ServoWorks.NET API 2010/7/13

C:\homeworks\PenAttention_v13_src\PenAttention_v13_src\PenAttention4\PenAttention\PenAttention.cs 1 using System; 2 using System.Diagnostics; 3 using

Lecture 8 Building an MDI Application

Your Company Name. Tel: Fax: Microsoft Visual Studio C# Project Source Code Output

LIGHT_P_TOGGLE, LIGHT_N_TOGGLE, BATTERY_TOGGLE, ALTERNATOR_TOGGLE, AVIONICS_TOGGLE, FLOAT_RETRACT, FLOAT_EXTEND }

II. Programming Technologies

RegEx-validate IP address. Defined below is the pattern for checking an IP address with value: String Pattern Explanation

JOURNAL OF OBJECT TECHNOLOGY

Answer on Question# Programming, C#

Flag Quiz Application

private string sconnection = ConfigurationManager.ConnectionStrings["Development"].ConnectionString

Chapter 12. Tool Strips, Status Strips, and Splitters

Визуал програмчлал. Багш: Ж. Шинэбаяр /Маг/

The first program we write will display a picture on a Windows screen, with buttons to make the picture appear and disappear.

LAMPIRAN A : LISTING PROGRAM

namespace Gen837X222A1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Chapter 8 Advanced GUI Features

In-Class Worksheet #4

IST311 Chapter13.NET Files (Part2)

Conventions in this tutorial

NI USB-TC01 Thermocouple Measurement Device

APARAT DE MASURA. Descrierea programului

Hands-On Lab (MBL04) Lab Manual Incorporating COM Objects into Your.NET Compact Framework 2.0 Application

Hands-On Lab. Lab: Client Object Model. Lab version: Last updated: 2/23/2011

Objects and Classes. Engineering 1D04, Teaching Session 9

Overview. Building a Web-Enabled Decision Support System. Integrating DSS in Business Curriculum. Introduction to DatabaseSupport Systems

namespace csharp_gen837x223a2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS2614 MODULE TEST 1

The Gracefulness of the Merging Graph N ** C 4 with Dotnet Framework

Class Test 5. Create a simple paint program that conforms to the following requirements.

Sub To Srt Converter. This is the source code of this program. It is made in C# with.net 2.0.

Appendix A Programkod

APÉNDICE J. CÓDIGO DEL ARCHIVO FORM1.CS EN LENGUAJE C# Comprende:

2.3 Add GDS Google Map to Visual Studio Toolbox and create a simple map project

Unit 1 Workbook ICS3U

Developing for Mobile Devices Lab (Part 1 of 2)

Chapter 6 Dialogs. Creating a Dialog Style Form

عنوان مقاله : خواندن و نوشتن محتوای فایل های Excel بدون استفاده ازAutomation Excel تهیه وتنظیم کننده : مرجع تخصصی برنامه نویسان

EE 356 Assigned: Oct. 4, 2017 Project 4 Due: Oct. 16, 2017

ListBox. Class ListBoxTest. Allows users to add and remove items from ListBox Uses event handlers to add to, remove from, and clear list

Savoy ActiveX Control User Guide

This is the start of the server code

Advanced Programming C# Lecture 2. dr inż. Małgorzata Janik

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1

private string sconnection = ConfigurationManager.ConnectionStrings["Development"].ConnectionString

Objects and Classes Continued. Engineering 1D04, Teaching Session 10

Getting Started with ComponentOne LiveLinq

Bachelor s Thesis: Building Web Application for Mahabad University Graduate Affairs Afsaneh Nezami Savojbolaghi

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

IOSR Journal of Engineering (IOSRJEN) e-issn: , p-issn: Vol. 3, Issue 8 (August. 2013), V3 PP 25-33

How to create a simple ASP.NET page to create/search data on baan using baan logic from the BOBS client sample.

Transcription:

CSIS 1624 CLASS TEST 6 Instructions: Use visual studio 2012/2013 Make sure your work is saved correctly Submit your work as instructed by the demmies. This is an open-book test. You may consult the printed text book but no electronic material. You may not communicate to anybody in anyway whatsoever. Marks will be subtracted if your student number and name is not in the program Question 1[63] Consider the scenario of an athletics meeting. Develop a class, CAthlete, with - a static array of items that are presented at the meeting, e.g. "100 m", "200 m", "400 m", "800 m", "1500 m", "5000 m", "110 m hurdles", "400 m hurdles", "Long Jump", "High Jump", "Triple Jump", "Discuss Throw", "Shot Put" and "Javelin Throw"; - a static parallel array containing whether the item is sorted ascending or descending; - a read-only properties for the name and gender of an athlete; - the item in which an athlete participates; - a property for the performance in a specific item; - a constructor that will assign the name of the athlete upon instantiation. Implement the class in a Windows forms application as in the example. - Fill the combobox with items from the static array in the class. Make sure that the user cannot enter anything else in the box. - Prepare a list of athletes. - The Add button should add a new athlete with details as in the controls, to the list. - Write the code to list all athletes in all items alphabetically.

- Write the code to list the athletes of a specific item in order of merit and gender. Note that for some items the order is in ascending order o performance (e.g. High Jump) and for others it is in descending order of performance, e.g. 100 m. You can ask the user for the item to list and gender in input boxes.

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Class_test_6 class CAthlete public static string[] arritems = new string [] "100 m", "200 m", "400 m", "800 m", "1500 m", "5000 m", "110 m hurdles", "400 m hurdles", "Long Jump", "High Jump", "Triple Jump", "Discuss Throw", "Shot Put", "Javelin Throw" ; public static char[] arrsorting = new char[] 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'D', 'D', 'D', 'D', 'D', 'D' ; public string Name get; private set; public char Gender get; private set; public string Performance get; set; private string sitem; public string Item get return sitem; set if (arritems.contains(value)) sitem = value; //Item //Constructor public CAthlete(string _Name, char _Gender ) Name = _Name; Gender = _Gender; //class CAthlete //namespace using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.VisualBasic; namespace Class_test_6 public partial class CfrmMeeting : Form private List<CAthlete> lstathletes; public CfrmMeeting() InitializeComponent(); private void CfrmMeeting_Load(object sender, EventArgs e)

cmboitems.items.addrange(cathlete.arritems); lstathletes = new List<CAthlete>(); //CfrmMeeting_Load private void btnclose_click(object sender, EventArgs e) Application.Exit(); private void btnadd_click(object sender, EventArgs e) try char Gender = radmale.checked? 'M' : 'F'; CAthlete Athlete = new CAthlete(txtName.Text, Gender ); Athlete.Item = cmboitems.text; Athlete.Performance = txtperformance.text; lstathletes.add(athlete); txtname.clear(); cmboitems.selecteditem = null; txtperformance.clear(); txtname.focus(); MessageBox.Show("Athlete added to list."); catch MessageBox.Show("Invalid performance. Athlete not added."); //btnadd_click private void btnlistalphabetically_click(object sender, EventArgs e) lstathletes = lstathletes.orderby(athlete => athlete.name).tolist(); string s = "Athlete".PadRight(20) + "Item".PadRight(10) + "\n" + "".PadRight(20, '=') + "".PadRight(10, '=') + "\n"; foreach (CAthlete athlete in lstathletes) s += athlete.name.padright(20) + athlete.item + "\n"; MessageBox.Show(s); //btnlistalphabetically_click private void btnlistmerit_click(object sender, EventArgs e) string sitem = Interaction.InputBox("Item:", "Select item", "", 200, 200); string sgender = Interaction.InputBox("Gender(M/F):", "What Gender", "", 200, 200); int j = CAthlete.arrItems.ToList().IndexOf(sItem); if(cathlete.arrsorting[j] == 'A') lstathletes = lstathletes.orderby(athlete => athlete.performance).tolist(); else lstathletes = lstathletes.orderbydescending(athlete => athlete.performance).tolist(); string s; if(sgender == "M") s = GetString(sItem, 'M'); else s = GetString(sItem, 'F'); MessageBox.Show(s); //btnlistmerit_click private string GetString(string sitem, char Gender) string s; s = "No\t" + "Athlete".PadRight(20) + "Performance".PadRight(10) + "\n" + "".PadRight(20, '=') + "".PadRight(10, '=') + "\n"; int i = 0; foreach (CAthlete athlete in lstathletes) if (athlete.item == sitem && athlete.gender == Gender) s += (++i).tostring().padleft(2) + "\t" + athlete.name.padright(20) + athlete.performance + "\n"; return s;

private void cmboitems_selectedindexchanged(object sender, EventArgs e) if(cmboitems.selecteditem!= null) if (CAthlete.arrSorting[cmboItems.SelectedIndex] == 'A') txtperformance.mask = "00:00.00"; else txtperformance.mask = ""; //public partial class CfrmMeeting : Form