Practices
We will do the practices together
1. Write a method that gets an integer from a text box and returns the cube of that number
2. Have three buttons share the same click event. In the event get the text of the button and display it on a label. (Just give me the code for the event)
3. Write the code to store a the value of a variable of type double in a Session.
4. Write the code to retrieve the variable in 3 from the session.
5. Write a method to clear a text box.
6. Create a simple HTML table with two columns and 3 rows
Programming Assignment
One of my students was asked to write a calculator in ASP.Net for a job interview. She was unsure how to do it. I want to make sure you will know how.
Create a calculator that has the 10 number keys (make each number key a button. All 10 keys should share the same event.)
The calculator should have 4 functions: Addition, Subtraction, Multiplication, and Division. When you click one of the four operators above, the program should store the number that was in the text box and clear it to make it ready for the next entry. It will also need to store the operator.
There should be a calculate or "=" button that does the operation whether add, subtract, multiply or divide and returns the result to the textbox. The calculator should also have a clear button to clear the textbox.
I would suggest using an html table to arrange the calculator.
You can add a style sheet to refine the display.
What I am looking for
Form layout 2 pts
using one method to handle all the numeric buttons 4 pts
Saving temporary variables in session states 4 pts
Addition multiplication and subtraction and Division 8 pts pts (1 pt each)
Clear button 2 pt
the total is worth 20 points
What to turn in
Post all the html asp and c# code in a Google doc and share it with spconger@gmail.com
No comments:
Post a Comment