202: TUTOR f17

TUTOR: Create a Math Tutor for 4th Grade Students

Video: Getting Started

1. Come to class as there may be corrections, changes and additions.
2. Code for READABILITY
3. Follow these directions to create a C# WINDOWS program.
4. Follow these directions to SUBMIT a folder called "TUTOR"


programprogram

program program


REQUIREMENTS

GET PROBLEM & GENERATE ANSWER ============================= New Problem Button to generate a random problem within range Random rand = new Random( ); int num1 = rand.Next(1, maxRange+1); ... if(radAddition.Checked == true) ... Generate ANSWER when problem is generated to use later when you check if correct! ... RadioButtons (3) determine if addition, subtraction or multiplication problem. RadioButtons (2) that determine the range of the problems (1-12 OR 1-24) NOTE: for more than one set of radio buttons, use groupboxes to maintain their independence. NOTE: choose one radio button in each group as default and set Checked property to true GET USER ANSWER & CHECK IF RIGHT AND GIVE MESSAGE/SHOW PICTURE ============================================================== TextBox where student enters their answer! Entering the answer in the TextBox enables the "Check Answer Button" (below): Check Answer Button Use try/catch OR TryParse to protect against bad input (function) When answer is checked: -Show/Hide 2 different PictureBoxes 1. IF RIGHT: show happy pic, hide sad pic OR 2. IF WRONG: show sad pic, hide happy pic -A ListBox will show the history of their problems and answers: 1. IF RIGHT: Tell them they are right and show problem OR 2. IF WRONG: Tell them they are wrong and show problem with CORRECT ANSWER USABILITY FEATURES ================== Label showing: # problems, # right, # wrong, percentage % update & show after each question NOTE: variables that are shared between methods must be declared at the class level (fields) Clear Button clears problems and answers disables check answer Exit Button (alt-x) confirm before exiting DialogResult returned by MessageBox - see my code page - c# windows code Timer interval = 1000 counts seconds / reset to zero? when? enable / disable? when? display somewhere?

CODE ===== 1. Interface: a. make form title bar = YOUR LAST NAME - TUTOR b. name the objects well (btn, txt, lbl, pic, rad, chk etc...) c. make interface clear (organize, label, size, color, placement) use groupboxes to organize related elements 2. Code: Readability / Naming (see guidelines) a. Main form (top): Name, Class, Date and Purpose b. EVERY Event Procedure one line (min) explaining what it does at TOP c. Good variable and object names d. Indenting, spacing e. Remove empty methods

CS/IS Major Challenge - no points, only name gloriously posted somewhere ------------------------------------------------------------------------ - WORK ON YOUR OWN!!! No collaboration. Sink or swim. Figure it out. - Add a button (btnSquaresRoots) that says "Squares and Roots" in teeny tiny font located in the lower left corner. - On click, expand the form width and make a tall, narrow-ish listbox (lstOut) appear. Then call a procedure (user-written) called SquaresRoots that has a single int parameter, 'count', that tells it how many numbers (starting at 1) for which to generate output. Use 15 as the argument. - SquaresRoots will loop and write to the listbox 'count' times. Each line will contain the number, the number squared and the square root (1 decimal place), nicely formatted in a mono-spaced font showing thousands separators and looking spiffy. - Exactly 3.5 seconds after list completion, make the listBox and button disappear and make the page go back to the original width. - EXTRA: After disappearing the ListBox and Button, make a sound.