Introduction to c#, computer programming, Programming Languages

All programs have to be done in console application.
Program 1, 2 and 3 are due on 2/11/12
Program 4, 5, and 6 are due on 2/18/12
Program 7, 8, and 9 are due on 2/25/12
Program 10 and 11 are due on 3/3/12




Program 1
You must create a simple math calculator. This calculator will start with the total of zero and allow the user to perform as many addition, subtraction, multiplication, and division operations as they desire. All operations will be applied to the total. So, for example, if the total is zero and the operations is addition, then a user specified amount will be added to total.
For this project you must:
Create and use a method that allows the user to enter an operator: +, -, *, or /. This method will return a char representing the operator that the user entered. Use the following function header:
char GetOperator();
Create and use a method that allows the user to enter an amount (like 12.34). This method will return the amount that the user entered as a float. Use the following function header:
float GetValue();
Use Console.Readline() to get input from the user.
Get the operator from the user
Get the value from the user
Calculate the new total from the user inputs
Use Console.Writeline() to display prompts and results for the user.
Prompt for user to operators and values
Display an updated total after each operation.

Program 2
You must write a C# program that acts as a math tutor for simple division problems. Your program will generate simple division math problems (where the dividend, divisor, and quotient are all integers – i.e. for [a / b = c], a, b, c will all be whole numbers) – the numbers will be selected “randomly”. The program allows the user to enter answers for each problem until they get the answer correct - the program will indicate to the user whether or not their answer is correct. When the user gets the correct answer, they will be asked if they want to quit or answer another problem. When the user says that they do not want to be given any more problems, the program will display the total number of correct answers, and the total number of incorrect answers that the user gave – then the program will end.
For this project you must:
Create and use a method that takes two integers as arguments (a minimum value and a maximum value) and returns a random integer value between the minimum and the maximum (inclusive).
Create and use a method that takes two integer arguments (a dividend and a divisor) and displays a division math problem for the user with the given dividend and divisor.
Create and use a method that prompts the user for their answer to a division problem and returns the user’s answer.
Create and use a method that poses a new division math problem to the user.
This method must use the method that gets a random integer to get two random integers be used to create the division problem.
This method will then call the method that displays a division math problem to display the newly created math problem for the user.
This method will then call the method that get the user’s answer.
This method will then test to see if the user’s answer is correct.
If the user’s answer is not correct then the program the problem will be redisplayed and the user will be prompted for another answer.
If the user’s answer is correct will tell the user that their answer is correct, and then this function will exit.
Create and use a class scoped global variable to store the number of correct answers and another class scoped global variable to store the number of incorrect answers.

Program 3
You must write a C# program that allows the user to input 10 integers. These 10 integers will be stored in an array. The program will then calculate and display the minimum number and maximum number in the array, as well as the sum, and the average of all the numbers in the array.
For this project you must:
Create an int array variable in your main method.
Create and use a method that prompts the user to enter an integer and that returns that integer value.
Create and use a method that takes no arguments and creates and populates an int array with values that the user enters. This method should return the int array to the caller.
Create and use a method that takes an array of integers as an argument and returns the largest value in the array.
Create and use a method that takes an array of integers as an argument and returns the smallest value in the array.
Create and use a method that takes an array of integers as an argument and returns the sum of all values in the array.
Create and use a method that takes an array of integers as an argument and returns the average of all values in the array.

Program 4
You must write a C# program that allows the user to draw simple images using Turtle Graphics commands. The Logo language made famous the concept of turtle graphics. Imagine a mechanical turtle that walks around the room under the control of a program. The turtle holds a pen in one of two positions, up or down. While the pen is down, the turtle traces out shapes as it moves; while the pen is up, the turtle moves about without writing anything. In this problem, you will simulate the operation of the turtle and create a computerized sketchpad. Use a 20-by-20 integer array named floor, which is initialized to zeros. Store a command from an array that contains them. At all times, keep track of the current position of the turtle and whether the pen is up or down. Assume that the turtle always starts at position 0,0 of the floor with its pen up. The set of turtle commands your program must process are as follows:
Command Meaning
1 Pen up
2 Pen down
3 Turn right
4 Turn left
5,10 Move forward 10 spaces (or a number other than 10)
6 Print the 20-by-20 array
9 End of data (sentinel)
Suppose that the turtle is somewhere near the center of the floor. The following “program” would draw and print a 12-by-12 square, leaving the pen in the up position:
2
5,12
3
5,12
3
5,12
3
5,12
1
6
9
As the turtle moves with the pen down, set the appropriate elements of array floor to 1s. When the 6 command (print) is given, wherever there is a 1 in the array, display an asterisk or another character. Wherever there is a zero, display a blank.
For this project you must:
Create and use a two-dimensional array of integers named floor.
This array will represent the drawing surface – drawn areas are marked with the value one, while un-drawn areas are marked with zeros
Create and use a two-dimensional array of integers named commands.
This array will store the list of commands that the user enters – the second dimension will be used only for the distance data for move commands.
Create and use an enum representing the basic commands – with one member per command (i.e. Pen up, Pen down, Turn right, Turn left, Move forward, Print, End of data)
Use good modular design principles – in other words, make good use of methods/functions. Each procedure should perform a single well defined task.

Program 5
You must write a C# program that opens and reads in data from a text file containing employee information including first name, last name, job title, hourly wage, and hours worked. This program will calculate the pay for each employee in the input file (based on their hourly wage and the hours they worked). This program will produce an output to the screen and an output to another text file with the first and last name of each employee followed by their calculated pay.
For this project you must:
Create and use a struct named Employee with the following data members for first name, last name, job title, hourly wage, hours worked, and pay.
Create and use a List of Employees.
Load and parse an input file containing employee information including first name, last name, job title, hourly wage, and hours worked.
Each line in the file will contain the information for one employee.
For each line in the file you will add an Employee struct object with that employee’s data, to the List of Employees.
For each Employee struct object in the List of Employee you will calculate the pay for that employee and store the result in the pay data member of that Employee struct object.
Open an output text file.
For each Employee struct object in the List of Employee you will output to the output txt file the first name, last name, and pay for that employee, on a separate line in the file. You will also output the same information to the screen.

Program 6
You must create a simple employee database program. The user will be able to input the data for 10 employees. The program will then list all employees with their pay (if the employee is “highly paid” (paid more than $20/hr or more than $800 for this pay period) then an asterisk (*) will appear next to their name. You must implement this program using object-oriented concepts and the practice of separate compilation (separate header files and source code files), with appropriately scoped identifiers, and using at least one namespace.
For this project you must:
Create and use an employee class with the following members.
Data members (all privately scoped)
A name data member
A job title data member
An hourly wage data member
An hours worked data member
Property members (all publicly scoped)
A name property with get and set
A job title property with get and set
An hourly property with get and set
An hours property with get and set
Constructors members
An explicit constructor that can initialize the data members with arguments

Program 7
You must create a simple employee payroll program capable of servicing 50 employees. The user must be able to enter information for new employees, update employee information, and pay all employees who are currently on the payroll.
For this project you must:
Create and use an Address class with the following properties:
Street-Address
Apartment Number
City
State
Zip
Your Address class must have implicit and explicit constructors
Your Address class must override the ToString() method.
Create and use a Person class with the following properties:
First Name
Last Name
Phone Number
Your person class must also contain an instance of the address class.
Your Person class must have implicit and explicit constructors
Your Person class must override the ToString() method.
Create and use an Employee class with the following properties:
Job Title
Wage
Hours Worked
Whether or not this employee is On the Payroll
Your employee class must inherit from the person class
Your Employee class must also have a pay method that returns the employee’s pay based on his or her wage and hours worked.
Your Employee class must have implicit and explicit constructors
Your Employee class must override the ToString() method.
Create and use an array of Employee objects.
This project must be implemented as a console application.

Program 8
You must analyze the following problem and design a good object oriented solution. Your analysis must include a complete set of CRC cards for the problem, and a detailed UML class diagram specifying the design of your solution.
Your CRC cards must be complete and accurate
Each entity in the model must be represented by a card
All responsibilities for this entity must be clearly specified
All collaborators to this entity must be clearly identified.
Your UML class diagram must accurately reflect your CRC cards.
Your UML class diagram must include:
Class names
Attributes with type and visibility information
Methods with type and visibility information
Inheritance and aggregation relationships
The Problem:
The software to be designed is a program that can be used to maintain an address book. An address book holds a collection of entries, each recording a person''s first and last name, address, city, state, zip, and phone number.
It must be possible to add a new person to an address book, to edit existing information about a person (except the person''s name), and to delete a person. It must be possible to sort the entries in the address book alphabetically by last name (with ties broken by first name if necessary), or by ZIP code (with ties broken by name if necessary). It must be possible to print out all the entries in the address book in "mailing label" format.
It must be possible to create a new address book, to open a disk file containing an existing address book to close an address book, and to save an address book to a disk file, using standard New, Open, Close, Save and Save As ... File menu options. The program''s File menu will also have a Quit option to allow closing all open address books and terminating the program.
The initial requirements call for the program to only be able to work with a single address book at a time; therefore, if the user chooses the New or Open menu option, any current address book will be closed before creating/opening a new one. A later extension might allow for multiple address books to be open, each with its own window which can be closed separately, with closing the last open window resulting in terminating the program. In this case, New and Open will result in creating a new window, without affecting the current window.
The program will keep track of whether any changes have been made to an address book since it was last saved, and will offer the user the opportunity to save changes when an address book is closed either explicitly or as a result of choosing to create/open another or to quit the program.
The program will keep track of the file that the current address book was read from or most recently saved to, will display the file''s name as the title of the main window, and will use that file when executing the Save option. When a New address book is initially created, its window will be titled "Untitled", and a Save operation will be converted to Save As ... - i.e. the user will be required to specify a file.

Program 9
You must modify your simple employee payroll program. Your Address, Person, and Employee classes should throw appropriate exceptions when misused (i.e. if an attempt is made to pass a negative value in to the wage property). Also, your client code (the code that uses your classes) should be prepared to catch any and all exceptions that might be thrown by your classes or other classes.
For this project you must:
Add code to throw appropriate exceptions to the set procedures of all properties that can possible be passed invalid data. These properties will include (but may not be limited to):
Phone Number (Person)
Wage (Employee)
Hours Worked (Employee)
Add code to catch (and appropriately handle) any and all exceptions that might be thrown:
This project must be implemented as a console application.

Program 10
You must modify your simple employee payroll program. You will use the same classes that you used for the program 9 project. But, you will create a GUI rather than a text based console interface for the application.
For this project you must:
Create and use a Windows Form that will contain and implement:
Textboxes for user input
Labels
At least one Checkbox
At least one Listbox
At least three Buttons
A MainMenu control

Program 11
Design and code a BankAccount class. This class must maintain a balance (which must never be negative) and an interest rate (which must be between 0% and 100%). Your class must have a default constructor (which initializes all data members to valid values), and at least one parameterized constructor. Your class must also have a read only Balance property that will return the current balance of the account, as well as a read/write InterestRate property. Your class must have methods for Deposit, Withdrawal, and ApplyInterest.
Design and code an application (can be console or GUI) that allows the user to instantiate and exercise a BankAccount object. The user must be able to assign an initial balance and an interest rate. The user must also be able to make deposits, withdrawals, and apply interest repeatedly. The application must validate all user input so that no invalid data is accepted, and no errors occur. The application must show the updated account balance after each operation (deposits, withdrawals, and apply interest) that the user initiates.
Also, you must justify your choice of data types in your comments, validate all data in UI and at Class Interface (i.e. Property values and Method arguments), insure that the balance can not become negative and that he account can not be overdrawn, and the interest rate must be between 0 and 1 (i.e. a percentage).
Posted Date: 2/8/2012 5:56:11 PM | Location : United States







Related Discussions:- Introduction to c#, computer programming, Assignment Help, Ask Question on Introduction to c#, computer programming, Get Answer, Expert's Help, Introduction to c#, computer programming Discussions

Write discussion on Introduction to c#, computer programming
Your posts are moderated
Related Questions
AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embedded Linux Development Kit (ELDK), and Xenomai A. Description of the Project The project's objective is to design a set of

Advantages of java stored procedures Transactions Although a saved process contains SQL orders, once collected it will socialize with SQL Hosting server very diversely from

You will be working on creating both a realistic project environment and on adding new features to a simple shell implementation provided in shell.tar.z. After you un-tar it, let's

Silver light uses WPF to provide included web handles Microsoft Technologies Silverlight uses WPF to provide included web handles similar to Adobe Display, but with more focus on a

One of the main strengths of the Perl programming language are its powerful text manipulation features. In this assignment, you will put them to use for writing a Perl program tha

HOW CAN I DESIGN A MOBILE WEB BROWSER LIKE OPERA MINI. USING VISUAL BASIC? HELP ME.

Complete the following program to move a value of 0xFFH to PORTB LIST p=18f4550 #include org 0x0000 movlw 0x00 _________ movlw 0xFF movwf PORTB end .

Task: This assignment is about writing programmes and Web Services in C#: 1) Develop a console programme that reads a sequence of integer numbers from the console and sorts

#questCustomers of a particular restaurant are described with some categories. If the categories indicate the customer is a senior citizen, or the customer works for the restaurant

Solve the following initial value problem y (3) - 5y'' - 22y' + 56 y= 0;       y(0) = 1;           y'(0) = -2;         y''(0) = -4 Solution : r 3 - 5r 2 - 22r + 56 = (