Class Test 10. Question 1. Create a console application using visual studio 2012 ultimate.

Size: px
Start display at page:

Download "Class Test 10. Question 1. Create a console application using visual studio 2012 ultimate."

Transcription

1 Class Test 10 Question 1 Create a console application using visual studio 2012 ultimate. Figure 1 Use recursion to create a menu, DO NOT use a while, do while or for loop. When any value is entered that is not part of the menu choices, the menu must be shown again. After each menu option is finished executing the menu must be shown again, except for the exit option which closes the program. You may use global variables for this program. See figure 1. Menu option A: Call a method that makes use of a do while loop to prompt the user to enter a valid number. This number will be the amount of values that will be entered. See figure 2. Figure 2 Menu option B: Call a method that uses a for loop to prompt the user to enter a value(string or int) for the amount of times specified by menu option A. Determine if the value entered is a number or text and store it in the appropriate variable. See figure 3. Figure 3 Menu Option C: Display the numbers, text, amount of numbers and the amount of text. See figure 4. Figure 4

2 Question 2 Consider the following scenario: A boy, Peter had his birthday and got R500. He wants to buy toys for himself with his birthday money. He decides to spend almost all of it in one shopping trip on toys, but does not know beforehand what toys he wants. Peter refuses to leave the shop without at least buying one toy and when Peter decides on a toy to buy, he buys it and it can t be returned. Peter wants to know after he bought a toy if he can afford the next toy he is interested in and he wants to stop buying toys when he has less than R50 left. Draw a flowchart to assist Peter in his toy shopping. Question 3 Consider the flowchart in figure 5. This is a flowchart of a simple game. Create a console application that matches the flow chart. Figure 5 MEMO namespace Question1 class Program static int inumber, inumbercount, itextcount; static string snumbers, stext; static void Main(string[] args) inumber = inumbercount = itextcount = 0; snumbers = stext = ""; Menu(); private static void Menu() Console.Clear(); Console.WriteLine("(A)Enter number of values to enter");

3 Console.WriteLine("(B)Enter values"); Console.WriteLine("(C)Display Output"); Console.WriteLine("(X)Exit"); Console.Write("Choose one : "); switch (Console.ReadKey().KeyChar.ToString().ToUpper()[0]) case 'A': NumberOfValues(); Menu(); break; case 'B': EnterValues(); Menu(); break; case 'C': Output(); Menu(); break; case 'X': break; default: Menu(); break; private static void Output() Console.WriteLine("\nNumbers:\n" + snumbers); Console.WriteLine("\nText:\n" + stext); Console.WriteLine("Amount of numbers: " + inumbercount); Console.WriteLine("Amount of text: " + itextcount); Console.WriteLine("\nPress any key to return to menu..."); Console.ReadKey(); static void NumberOfValues() bool isvalid = false; do Console.Write("\nHow many values to be entered: "); isvalid = int.tryparse(console.readline(), out inumber); while (!isvalid); static void EnterValues() Console.WriteLine(); for (int i = 0; i < inumber; i++) int itemp; Console.Write("Value " + (i+1) + " : "); string stemp = Console.ReadLine(); bool isnumber = int.tryparse(stemp, out itemp); if (isnumber) snumbers += itemp.tostring() + "\n"; inumbercount++; stext += stemp + "\n"; itextcount++;

4 Question 2 Start Balance = 500 Get ToyPrice Balance -= ToyPrice Yes ToyPrice < Balance Yes No Display can afford toy and balance Balance > 50 No End Question 3 namespace Question_2 class Q3 static void Main(string[] args) Console.WriteLine("You found something!"); Console.Write("Is it alive?"); Console.Write("Is it a friend?"); Console.WriteLine("But what have they done for you lately?"); Console.Write("Still like them??"); //Still like them Console.Write("Is it scary?"); Console.Write("Does it jingle?");

5 Console.WriteLine("Definitely kill it"); Console.Write("Is it trying to talk to you?"); Console.WriteLine("Definitely kill it"); //Is it trying to talk to you //Does it jingle //Is it scary //Is it a friend Console.WriteLine("Smash it with a stick"); Console.Write("Is anything shiny left?"); Console.WriteLine("Boring. Find another thing"); //Is anything shiny left //Is it alive //Main //Class //Namespace

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS1614

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS1614 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS1614 DATE: 7 May 2015 MARKS: 130 ASSESSOR: Prof. P.J. Blignaut (Bonus marks: 5) MODERATOR: Dr. L. de Wet TIME: 180 minutes

More information

Engr 123 Spring 2018 Notes on Visual Studio

Engr 123 Spring 2018 Notes on Visual Studio Engr 123 Spring 2018 Notes on Visual Studio We will be using Microsoft Visual Studio 2017 for all of the programming assignments in this class. Visual Studio is available on the campus network. For your

More information

Answer the following questions on the answer sheet that is provided. The computer must be switched off while you are busy with Section A.

Answer the following questions on the answer sheet that is provided. The computer must be switched off while you are busy with Section A. UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 114 DATE: 25 April 2013 TIME: 180 minutes MARKS: 100 ASSESSORS: Prof. P.J. Blignaut & Mr. F. Radebe (+2 bonus marks) MODERATOR:

More information

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 114 CLASS TEST 2 and 3 DATE: 4 August 2014 TIME: 180 minutes MARKS: 70

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 114 CLASS TEST 2 and 3 DATE: 4 August 2014 TIME: 180 minutes MARKS: 70 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 114 CLASS TEST 2 and 3 DATE: 4 August 2014 TIME: 180 minutes MARKS: 70 ASSESSOR: Prof. P.J. Blignaut (+1 bonus mark) This

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Objects and classes: Basics of object and class in C#. Private and public members and protected. Static

More information

C# Programming for Developers Course Labs Contents

C# Programming for Developers Course Labs Contents C# Programming for Developers Course Labs Contents C# Programming for Developers...1 Course Labs Contents...1 Introduction to C#...3 Aims...3 Your First C# Program...3 C# The Basics...5 The Aims...5 Declaring

More information

General Certificate of Education Advanced Subsidiary Examination June 2010

General Certificate of Education Advanced Subsidiary Examination June 2010 General Certificate of Education Advanced Subsidiary Examination June 2010 Computing COMP1/PM/C# Unit 1 Problem Solving, Programming, Data Representation and Practical Exercise Preliminary Material A copy

More information

Getter and Setter Methods

Getter and Setter Methods Example 1 namespace ConsoleApplication14 public class Student public int ID; public string Name; public int Passmark = 50; class Program static void Main(string[] args) Student c1 = new Student(); Console.WriteLine("please..enter

More information

UNIVERSITY OF THE FREE STATE MAIN CAMPUS CSIS2614 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER:

UNIVERSITY OF THE FREE STATE MAIN CAMPUS CSIS2614 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: UNIVERSITY OF THE FREE STATE MAIN CAMPUS CSIS2614 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: 4012754 EXAMINATION: Additional Half Year Examination 2016 ASSESSORS: Prof. P.J. Blignaut

More information

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS 2614 MODULE TEST 2

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS 2614 MODULE TEST 2 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS CSIS 2614 MODULE TEST 2 DATE: 13 May 2016 TIME: 3.5 hours MARKS: 112 ASSESSOR: Prof. P.J. Blignaut BONUS MARKS: 5 MODERATOR:

More information

Introduction to C# Applications

Introduction to C# Applications 1 2 3 Introduction to C# Applications OBJECTIVES To write simple C# applications To write statements that input and output data to the screen. To declare and use data of various types. To write decision-making

More information

Memorandum. 1.1 public enum Days : int { Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 }

Memorandum. 1.1 public enum Days : int { Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 } Memorandum Question 1 1.1 public enum Days : int Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 7 1.2 class Temps private double[] Values = new double[7]; 1.3

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu Cali, Colombia Summer 2012 Lección 03 Control Structures Agenda 1. Block Statements 2. Decision Statements 3. Loops 2 What are Control

More information

Object Oriented Programming in C#

Object Oriented Programming in C# Introduction to Object Oriented Programming in C# Class and Object 1 You will be able to: Objectives 1. Write a simple class definition in C#. 2. Control access to the methods and data in a class. 3. Create

More information

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.

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. UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 124 DATE: 1 September 2014 TIME: 3 hours MARKS: 105 ASSESSORS: Prof. P.J. Blignaut BONUS MARKS: 3 MODERATOR: Dr. L. De Wet

More information

Introduction to Game Programming

Introduction to Game Programming Introduction to Game Programming Console video game Session 2 The game loop and user input Nacho Iborra IES San Vicente This work is licensed under the Creative Commons Attribution- NonCommercial-ShareAlike

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 : Structure declaration and initialization. Access to fields of structure. Array of Structs. 11/10/2016

More information

Decisions: Logic Java Programming 2 Lesson 7

Decisions: Logic Java Programming 2 Lesson 7 Decisions: Logic Java Programming 2 Lesson 7 In the Java 1 course we learned about if statements, which use booleans (true or false) to make decisions. In this lesson, we'll dig a little deeper and use

More information

static String usersname; public static int numberofplayers; private static double velocity, time;

static String usersname; public static int numberofplayers; private static double velocity, time; A class can include other things besides subroutines. In particular, it can also include variable declarations. Of course, you can declare variables inside subroutines. Those are called local variables.

More information

Algorithms via C# Course reference. Written by Artem Los.

Algorithms via C# Course reference. Written by Artem Los. Algorithms via C# Course reference 2012 Artem Los, updated 2015.11.30. 1 Written by Artem Los. www.artemlos.net This document contains descriptions of algorithms that are to be examined during the course.

More information

Quarter 1 Practice Exam

Quarter 1 Practice Exam University of Chicago Laboratory Schools Advanced Placement Computer Science Quarter 1 Practice Exam Baker Franke 2005 APCS - 12/10/08 :: 1 of 8 1.) (10 percent) Write a segment of code that will produce

More information

Visual C# 2010 Express

Visual C# 2010 Express Review of C# and XNA What is C#? C# is an object-oriented programming language developed by Microsoft. It is developed within.net environment and designed for Common Language Infrastructure. Visual C#

More information

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

UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: UNIVERSITY OF THE FREE STATE MAIN & QWA-QWA CAMPUS RIS 124 DEPARTMENT: COMPUTER SCIENCE AND INFORMATICS CONTACT NUMBER: 4012754 EXAMINATION: Main End-of-year Examination 2013 PAPER 1 ASSESSORS: Prof. P.J.

More information

POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE

POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE /. POLYTECHNIC OF NAMIBIA SCHOOL OF COMPUTING AND INFORMATICS DEPARTMENT OF COMPUTER SCIENCE COUR ENAME: PROGRAMMING 1 COUR ECODE: PRGSlOS NQFLEVEL: 5 DATE: JUNE 20 15 DURATION: 2HOURS MARKS: 100 PAPER:

More information

Problem Statement. A1: being lapped on the track

Problem Statement. A1: being lapped on the track Problem Statement A1: being lapped on the track You and your friend are running laps on the track at the rec complex. Your friend passes you exactly X times in one of your laps (that is, you start the

More information

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments

Objectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 17 Switch Statement (Refer Slide Time: 00:23) In

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

Loops. CSE 114, Computer Science 1 Stony Brook University

Loops. CSE 114, Computer Science 1 Stony Brook University Loops CSE 114, Computer Science 1 Stony Brook University http://www.cs.stonybrook.edu/~cse114 1 Motivation Suppose that you need to print a string (e.g., "Welcome to Java!") a user-defined times N: N?

More information

Problem Statement. B1: average speed

Problem Statement. B1: average speed Problem Statement B1: average speed A woman runs on tracks of different lengths each day. She always times the last lap. Use the time for the last lap (in seconds) and the length of the track (in miles)

More information

Objectives. Introduce static keyword examine syntax describe common uses

Objectives. Introduce static keyword examine syntax describe common uses Static Objectives Introduce static keyword examine syntax describe common uses 2 Static Static represents something which is part of a type rather than part of an object Two uses of static field method

More information

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book

Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book 1 Department of Networks College of Bardarash Technical Institute DUHOK Polytechnic University Subject: Programming Fundamental by JAVA Course Book Year 1 Lecturer's name: MSc. Sami Hussein Ismael Academic

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 5 Lecture 5-4: do/while loops, assertions reading: 5.1, 5.5 1 The do/while loop do/while loop: Performs its test at the end of each repetition. Guarantees that the loop's

More information

Chapter 5 Methods. public class FirstMethod { public static void main(string[] args) { double x= -2.0, y; for (int i = 1; i <= 5; i++ ) { y = f( x );

Chapter 5 Methods. public class FirstMethod { public static void main(string[] args) { double x= -2.0, y; for (int i = 1; i <= 5; i++ ) { y = f( x ); Chapter 5 Methods Sections Pages Review Questions Programming Exercises 5.1 5.11 142 166 1 18 2 22 (evens), 30 Method Example 1. This is of a main() method using a another method, f. public class FirstMethod

More information

204111: Computer and Programming

204111: Computer and Programming 204111: Computer and Programming Week 4: Control Structures t Monchai Sopitkamon, Ph.D. Overview Types of control structures Using selection structure Using repetition structure Types of control ol structures

More information

Pre C# Fundamentals. Course reference LEARNING. Updated:

Pre C# Fundamentals. Course reference LEARNING. Updated: 1 Pre C# Fundamentals Course reference This booklet contains a summary of what you will learn during this preparation course for C# Fundamentals. 2 Why a programming language? People express themselves

More information

Introduction to Computers and Engineering Problem Solving 1.00 / Fall 2004

Introduction to Computers and Engineering Problem Solving 1.00 / Fall 2004 Introduction to Computers and Engineering Problem Solving 1.00 / 1.001 Fall 2004 Problem Set 1 Due: 11AM, Friday September 17, 2004 Loan Calculator / Movie & Game Rental Store (0) [100 points] Introduction

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 5 Lecture 5-4: do/while loops, assertions reading: 5.1, 5.5 1 The do/while loop do/while loop: Performs its test at the end of each repetition. Guarantees that the loop's

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Overview. C# program structure. Variables and Constant. Conditional statement (if, if/else, nested if

More information

RIS214. Class Test 3

RIS214. Class Test 3 RIS214 Class Test 3 Use console applications to solve the following problems and employ defensive programming to prevent run-time errors. Every question will be marked as follows: mark = copied? -5 : runs?

More information

COPYRIGHTED MATERIAL. Part I The C# Ecosystem. ChapTEr 1: The C# Environment. ChapTEr 2: Writing a First Program

COPYRIGHTED MATERIAL. Part I The C# Ecosystem. ChapTEr 1: The C# Environment. ChapTEr 2: Writing a First Program Part I The C# Ecosystem ChapTEr 1: The C# Environment ChapTEr 2: Writing a First Program ChapTEr 3: Program and Code File Structure COPYRIGHTED MATERIAL 1The C# Environment What s in This ChapTEr IL and

More information

Memorandum public override string string Node while null return public void bool false Node while null null true while public void Node new

Memorandum public override string string Node while null return public void bool false Node while null null true while public void Node new Memorandum 1.1.1 public override string ToString() string s = ""; while (current!= null) s += current.element.tostring() + ", "; current = current.next; return s; //ToString() 1.1.2 public void Sort()

More information

Warmups! Write down & Plot the points on the graph

Warmups! Write down & Plot the points on the graph Warmups! Write down & Plot the points on the graph 1) 3,5 2) 2, 4 3) 3,6 4) 0,4 3.1-3.2 functions All you need to know about function and relations. 1 Goal: Understand relations and functions Review what

More information

DCS235 Software Engineering Exercise Sheet 2 Using Java Collections

DCS235 Software Engineering Exercise Sheet 2 Using Java Collections DCS235 Software Engineering Exercise Sheet 2 Using Java Collections Prerequisites October 2004 You should understand Java interfaces. If you need to revise this, see Jia section 4.4.7 and 5.3. You should

More information

Question: Total Points: Score:

Question: Total Points: Score: CS 170 Exam 1 Section 003 Fall 2013 Name (print): Instructions: Keep your eyes on your own paper and do your best to prevent anyone else from seeing your work. Do NOT communicate with anyone other than

More information

Learn C# Errata. 3-9 The Nullable Types The Assignment Operators

Learn C# Errata. 3-9 The Nullable Types The Assignment Operators 1 The following pages show errors from the original edition, published in July 2008, corrected in red. Future editions of this book will be printed with these corrections. We apologize for any inconvenience

More information

CannonAttack v1.0. A Test Driven Development Tutorial in C# 4.0 Author: Dominic Millar Tech Review:Matt Rumble Editor:Cathy Tippett

CannonAttack v1.0. A Test Driven Development Tutorial in C# 4.0 Author: Dominic Millar Tech Review:Matt Rumble Editor:Cathy Tippett CannonAttack v1.0 A Test Driven Development Tutorial in C# 4.0 Author: Dominic Millar Tech Review:Matt Rumble Editor:Cathy Tippett http://domscode.com Introduction Defining the Battlefield This tutorial

More information

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable? Peer Instruction 8 Classes and Objects How can multiple methods within a Java class read and write the same variable? A. Allow one method to reference a local variable of the other B. Declare a variable

More information

VB CONSOLE SUMMER WORK. Introduction into A Level Programming

VB CONSOLE SUMMER WORK. Introduction into A Level Programming VB CONSOLE SUMMER WORK Introduction into A Level Programming DOWNLOAD VISUAL STUDIO You will need to Download Visual Studio Community 2013 to create these programs https://www.visualstudio.com/ en-us/products/visual-studiocommunity-vs.aspx

More information

Overall Strategy OK SO LETS BEGIN!!! Brandon Sean InnerCircle Coaching Overall Strategy

Overall Strategy OK SO LETS BEGIN!!! Brandon Sean InnerCircle Coaching Overall Strategy Overall Strategy You can start this even if you're a complete beginner Many people I know whom I shared my experience and knowlegde with are making good consistent money online, one of my friend recently

More information

Chapter 17 - Notes Recursion

Chapter 17 - Notes Recursion Chapter 17 - Notes Recursion I. Recursive Definitions A. Recursion: The process of solving a problem by reducing it to smaller versions of itself. B. Recursive Function: A function that calls itself. C.

More information

Occupied versus Unoccupied

Occupied versus Unoccupied A1 Problem Statement Occupied versus Unoccupied Most houses have an electricity meter that records the amount of electricity that has been used since the meter was installed. This is typically recorded

More information

Introduction to. second print. Copyright HKTA Tang Hin Memorial Secondary School

Introduction to. second print. Copyright HKTA Tang Hin Memorial Secondary School Introduction to 1 VISUAL BASIC 2016 edition second print Copyright HKTA Tang Hin Memorial Secondary School 2016-17 Table of Contents. Preface....................................................... Chapter.......

More information

ISRA University Faculty of IT. Textbook BARBARA DOYLE C# Programming: From Problem Analysis to Program Design 4 th Edition

ISRA University Faculty of IT. Textbook BARBARA DOYLE C# Programming: From Problem Analysis to Program Design 4 th Edition 4 Programming Fundamentals 605116 ISRA University Faculty of IT Textbook BARBARA DOYLE C# Programming: From Problem Analysis to Program Design 4 th Edition Prepared by IT Faculty members 1 5 Console Input

More information

Design Patterns. 1. What is a design pattern? Can you think about any analogies to define them?

Design Patterns. 1. What is a design pattern? Can you think about any analogies to define them? Design Patterns Name: ID: These questions do not have a formal, definitive answer. They are meant to be food for thoughts. Feel free to seek answers on browsing the Internet, talking to other software

More information

Variable initialization and assignment

Variable initialization and assignment Variable initialization and assignment int variable_name; float variable_name; double variable_name; String variable_name; boolean variable_name; Initialize integer variable Initialize floating point variable

More information

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

UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 UNIVERSITY OF THE FREE STATE DEPARTMENT OF COMPUTER SCIENCE AND INFORMATICS RIS 214 MODULE TEST 1 DATE: 12 March 2014 TIME: 4 hours MARKS: 220 ASSESSORS: Prof. P.J. Blignaut & Mr G.J. Dollman BONUS MARKS:

More information

1/9/2015. Intro to CS: Java Review Assignment Due Dates Chapter 7 7.1: while Loops 7.2: for Loops Ch7 Work Time. Chapter 7 Iteration WHILE LOOPS

1/9/2015. Intro to CS: Java Review Assignment Due Dates Chapter 7 7.1: while Loops 7.2: for Loops Ch7 Work Time. Chapter 7 Iteration WHILE LOOPS Chapter 7 Iteration The Plan For Today Intro to CS: Java Review Assignment Due Dates Chapter 7 7.1: while Loops 7.2: for Loops Ch7 Work Time WHILE LOOPS Executes a block of code repeatedly A condition

More information

Creating a Transacted Resource Using System.Transactions (Lab 2) (Visual C#, Visual Basic)

Creating a Transacted Resource Using System.Transactions (Lab 2) (Visual C#, Visual Basic) 1 System.Transactions in Whidbey Creating a Transacted Resource Using System.Transactions (Lab 2) (Visual C#, Visual Basic) For the Visual Basic lab, go to page 17. Objectives After completing this lab,

More information

VISUAL PROGRAMMING_IT0309 Semester Number 05. G.Sujatha & R.Vijayalakshmi Assistant professor(o.g) SRM University, Kattankulathur

VISUAL PROGRAMMING_IT0309 Semester Number 05. G.Sujatha & R.Vijayalakshmi Assistant professor(o.g) SRM University, Kattankulathur School of Computing, 12/26/2012 1 VISUAL PROGRAMMING_IT0309 Semester Number 05 G.Sujatha & R.Vijayalakshmi Assistant professor(o.g) SRM University, Kattankulathur UNIT 1 School of Computing, Department

More information

Getting Started. 1 by Conner Irwin

Getting Started. 1 by Conner Irwin If you are a fan of the.net family of languages C#, Visual Basic, and so forth and you own a copy of AGK, then you ve got a new toy to play with. The AGK Wrapper for.net is an open source project that

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Pointers: Pointer declaration and initialization. Pointer To Pointer. Arithmetic operation on pointer

More information

IMPORTANT WORDS AND WHAT THEY MEAN

IMPORTANT WORDS AND WHAT THEY MEAN MOBILE PHONES WHAT IS DATA Data is Internet. It can let you do lots of different things on your phone or tablet. You can send or receive texts, emails or photos, listen to music, watch TV shows, movies

More information

IST311. Advanced Issues in OOP: Inheritance and Polymorphism

IST311. Advanced Issues in OOP: Inheritance and Polymorphism IST311 Advanced Issues in OOP: Inheritance and Polymorphism IST311/602 Cleveland State University Prof. Victor Matos Adapted from: Introduction to Java Programming: Comprehensive Version, Eighth Edition

More information

Session A First Game Program

Session A First Game Program 1 Session 11.1 A First Game Program Chapter 11.1: A First Game Program 2 Session Overview Begin the creation of an arcade game Learn software design techniques that apply to any form of game development

More information

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case Lesson11-Inheritance-Abstract-Classes The GeometricObject case GeometricObject class public abstract class GeometricObject private string color = "White"; private DateTime datecreated = new DateTime(2017,

More information

1.00 Introduction to Computers and Engineering Problem Solving. Quiz 1 March 7, 2003

1.00 Introduction to Computers and Engineering Problem Solving. Quiz 1 March 7, 2003 1.00 Introduction to Computers and Engineering Problem Solving Quiz 1 March 7, 2003 Name: Email Address: TA: Section: You have 90 minutes to complete this exam. For coding questions, you do not need to

More information

C# - Reflection. It allows examining various types in an assembly and instantiate these types.

C# - Reflection. It allows examining various types in an assembly and instantiate these types. C# - Reflection Reflection objects are used for obtaining type information at runtime. The classes that give access to the metadata of a running program are in the System.Reflection namespace. The System.Reflection

More information

Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word. Chapter 1 Introduction to Computers, Programs, and Java

Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word. Chapter 1 Introduction to Computers, Programs, and Java Basic computer skills such as using Windows, Internet Explorer, and Microsoft Word Chapter 1 Introduction to Computers, Programs, and Java Chapter 2 Primitive Data Types and Operations Chapter 3 Selection

More information

VB Net Debugging (Console)

VB Net Debugging (Console) VB Net Debugging (Console) Introduction A bug is some sort of error in the code which can prevent your program from running properly. When. you write a substantial program always assume that it contains

More information

REPETITION CONTROL STRUCTURE LOGO

REPETITION CONTROL STRUCTURE LOGO CSC 128: FUNDAMENTALS OF COMPUTER PROBLEM SOLVING REPETITION CONTROL STRUCTURE 1 Contents 1 Introduction 2 for loop 3 while loop 4 do while loop 2 Introduction It is used when a statement or a block of

More information

CS 101 Fall 2005 Midterm 2 Name: ID:

CS 101 Fall 2005 Midterm 2 Name:  ID: This exam is open text book but closed-notes, closed-calculator, closed-neighbor, etc. Questions are worth different amounts (in particular, the final two questions are worth substantially more than any

More information

Menu Driven Systems. While loops, menus and the switch statement. Mairead Meagher Dr. Siobhán Drohan. Produced by:

Menu Driven Systems. While loops, menus and the switch statement. Mairead Meagher Dr. Siobhán Drohan. Produced by: Menu Driven Systems While loops, menus and the switch statement Produced by: Mairead Meagher Dr. Siobhán Drohan Department of Computing and Mathematics http://www.wit.ie/ Topics list while loops recap

More information

Pull Lecture Materials and Open PollEv. Poll Everywhere: pollev.com/comp110. Lecture 12. else-if and while loops. Once in a while

Pull Lecture Materials and Open PollEv. Poll Everywhere: pollev.com/comp110. Lecture 12. else-if and while loops. Once in a while Pull Lecture Materials and Open PollEv Poll Everywhere: pollev.com/comp110 Lecture 12 else-if and while loops Once in a while Fall 2016 if-then-else Statements General form of an if-then-else statement:

More information

1. Find the output of following java program. class MainClass { public static void main (String arg[])

1. Find the output of following java program. class MainClass { public static void main (String arg[]) 1. Find the output of following java program. public static void main(string arg[]) int arr[][]=4,3,2,1; int i,j; for(i=1;i>-1;i--) for(j=1;j>-1;j--) System.out.print(arr[i][j]); 1234 The above java program

More information

Professional ASP.NET Web Services : Asynchronous Programming

Professional ASP.NET Web Services : Asynchronous Programming Professional ASP.NET Web Services : Asynchronous Programming To wait or not to wait; that is the question! Whether or not to implement asynchronous processing is one of the fundamental issues that a developer

More information

Midterm Practice TA: Brian Choi Section Webpage:

Midterm Practice TA: Brian Choi Section Webpage: Midterm Practice TA: Brian Choi (schoi@cs.ucla.edu) Section Webpage: http://www.cs.ucla.edu/~schoi/cs32 *** Make sure you try all exercises by hand! You won t have access to Visual C++ during the exam.

More information

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

Class Test 5. Create a simple paint program that conforms to the following requirements. Class Test 5 Question 1 Use visual studio 2012 ultimate to create a C# windows forms application. Create a simple paint program that conforms to the following requirements. The control box is disabled

More information

Lab - 10 Write a c# program to prepend the namespace name by calling the namespaceenabled version of either function or variable?

Lab - 10 Write a c# program to prepend the namespace name by calling the namespaceenabled version of either function or variable? Lab - 10 Write a c# program to prepend the namespace name by calling the namespaceenabled version of either function or variable? namespace first_space class namespace_cl Console.WriteLine("Inside first_space");

More information

Class Test 4. Question 1. Use notepad to create a console application that displays a face. See figure 1. Figure 1. Question2

Class Test 4. Question 1. Use notepad to create a console application that displays a face. See figure 1. Figure 1. Question2 Class Test 4 Marks will be deducted for the following: -2 If the program is named anything other than Question1,2 etc. -5 if the program does not contain your name & student number at the top. Question

More information

Unit 10: Sorting/Searching/Recursion

Unit 10: Sorting/Searching/Recursion Unit 10: Sorting/Searching/Recursion Exercises 1. If you search for the value 30 using a linear search, which indices of the 2. If you search for the value -18 using a binary search, which indices of the

More information

Final Exam Review April 18, 2018

Final Exam Review April 18, 2018 Engr 123 Name Final Exam Review April 18, 2018 Final Exam is Monday April 30, 2018 at 8:00am 1. If i, j, and k are all of type int and i = 0, j = 2, and k = -8, mark whether each of the following logical

More information

Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College (

Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College ( For Loops: Will Tanna Assignment Definition And General Feedback By Michael Panitz at Cascadia Community College (http://www.cascadia.edu) Table of contents: Summary When To Use and Avoid This Example

More information

Name Section Number. CS210 Exam #3 *** PLEASE TURN OFF ALL CELL PHONES*** Practice

Name Section Number. CS210 Exam #3 *** PLEASE TURN OFF ALL CELL PHONES*** Practice Name Section Number CS210 Exam #3 *** PLEASE TURN OFF ALL CELL PHONES*** Practice All Sections Bob Wilson OPEN BOOK / OPEN NOTES: You will have all 90 minutes until the start of the next class period.

More information

More about Loops and Decisions

More about Loops and Decisions More about Loops and Decisions 5 In this chapter, we continue to explore the topic of repetition structures. We will discuss how loops are used in conjunction with the other control structures sequence

More information

Punctuation 1. How to use commas semi-colons. Commas (,) First of all, you need to drink regularly to avoid dehydration.

Punctuation 1. How to use commas semi-colons. Commas (,) First of all, you need to drink regularly to avoid dehydration. Punctuation 1 How to use commas semi-colons Commas (,) A comma marks a slight break between different parts of a sentence. Used properly, commas make the meaning of sentences clear by grouping and separating

More information

INFORMATICS LABORATORY WORK #2

INFORMATICS LABORATORY WORK #2 KHARKIV NATIONAL UNIVERSITY OF RADIO ELECTRONICS INFORMATICS LABORATORY WORK #2 SIMPLE C# PROGRAMS Associate Professor A.S. Eremenko, Associate Professor A.V. Persikov 2 Simple C# programs Objective: writing

More information

JOptionPane Dialogs. javax.swing.joptionpane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs.

JOptionPane Dialogs. javax.swing.joptionpane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs. JOptionPane Dialogs javax.swing.joptionpane is a class for creating dialog boxes. Has both static methods and instance methods for dialogs. Easy to create 4 Common Dialogs: Message Dialog - display a message

More information

USB-1608G CSharp (C#) External Trigger Auto Retrigger

USB-1608G CSharp (C#) External Trigger Auto Retrigger The following example demonstrates how to set the API to automatically re-arm the trigger after an acquisition has completed. This program uses the External Trigger input and once received, a fixed amount

More information

XNA Tutorials Utah State University Association for Computing Machinery XNA Special Interest Group RB Whitaker 21 December 2007

XNA Tutorials Utah State University Association for Computing Machinery XNA Special Interest Group RB Whitaker 21 December 2007 XNA Tutorials Utah State University Association for Computing Machinery XNA Special Interest Group RB Whitaker 21 December 2007 Console Windows Supplementary Tutorial 8 Overview The majority of beginning

More information

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain

Duhok Polytechnic University Amedi Technical Institute/ IT Dept. Halkawt Rajab Hussain Duhok Polytechnic University Amedi Technical Institute/ IT Dept. By Halkawt Rajab Hussain 2016-04-02 Inheritance: Concept of Inheritance. Types of inheritance. Virtual base class method. Interface. 4/1/2017

More information

DC69 C# &.NET JUNE C# is a simple, modern, object oriented language derived from C++ and Java.

DC69 C# &.NET JUNE C# is a simple, modern, object oriented language derived from C++ and Java. Q.2 a. What is C#? Discuss its features in brief. 1. C# is a simple, modern, object oriented language derived from C++ and Java. 2. It aims to combine the high productivity of Visual Basic and the raw

More information

Unit 9 Tech savvy? Tech support. 1 I have no idea why... Lesson A. A Unscramble the questions. Do you know which battery I should buy?

Unit 9 Tech savvy? Tech support. 1 I have no idea why... Lesson A. A Unscramble the questions. Do you know which battery I should buy? Unit 9 Tech savvy? Lesson A Tech support 1 I have no idea why... A Unscramble the questions. 1. which battery / Do you know / should / buy / I? Do you know which battery I should buy? 2. they / where /

More information

Text Input and Conditionals

Text Input and Conditionals Text Input and Conditionals Text Input Many programs allow the user to enter information, like a username and password. Python makes taking input from the user seamless with a single line of code: input()

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

C++ Programming Lecture 13 Software Engineering Group

C++ Programming Lecture 13 Software Engineering Group C++ Programming Lecture 13 Software Engineering Group Philipp D. Schubert Contents 1. Introduction to the project 1. Reading files 2. Smith-Waterman algorithm 3. Comparing the sequences / parallelization

More information

Good Luck! CSC207, Fall 2012: Quiz 1 Duration 25 minutes Aids allowed: none. Student Number:

Good Luck! CSC207, Fall 2012: Quiz 1 Duration 25 minutes Aids allowed: none. Student Number: CSC207, Fall 2012: Quiz 1 Duration 25 minutes Aids allowed: none Student Number: Last Name: Lecture Section: L0101 First Name: Instructor: Horton Please fill out the identification section above as well

More information

University of Palestine. Mid Exam Total Grade: 100

University of Palestine. Mid Exam Total Grade: 100 First Question No. of Branches (5) A) Choose the correct answer: 1. If we type: system.out.println( a ); in the main() method, what will be the result? int a=12; //in the global space... void f() { int

More information

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

Advanced Programming C# Lecture 11 part 2. dr inż. Małgorzata Janik Advanced Programming C# Lecture 11 part 2 dr inż. Małgorzata Janik malgorzata.janik@pw.edu.pl Winter Semester 2018/2019 LINQ (part 2) LINQ Previous lecture... 3 / 24 LINQ to SQL Architecture of LINQ to

More information

Let s get started! You first need to download Visual Studio to edit, compile and run C# programs. Download the community version, its free.

Let s get started! You first need to download Visual Studio to edit, compile and run C# programs. Download the community version, its free. C# Mini Lessons last update May 15,2018 From http://www.onlineprogramminglessons.com These C# mini lessons will teach you all the C# Programming statements you need to know, so you can write 90% of any

More information