Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quiz. Quiz Three Type your name, ID and email address in the.asm file. MUST DO. If not, you will receive a score of zero. Change the folder name to yourStudentID_q3.

Similar presentations


Presentation on theme: "Quiz. Quiz Three Type your name, ID and email address in the.asm file. MUST DO. If not, you will receive a score of zero. Change the folder name to yourStudentID_q3."— Presentation transcript:

1 Quiz

2 Quiz Three Type your name, ID and email address in the.asm file. MUST DO. If not, you will receive a score of zero. Change the folder name to yourStudentID_q3. Submission: zip the folder and upload to E3 platform. You did quite well to improve your programming skill. You want to be a professional programmer and write something that is useful. Today, you want to implement a simple program using a random number generator.

3 Quiz Three Show a menu 1) Floating point calculation 2) Simple control Please press a key to continue …

4 Option one Floating point calculation 1.[1%] Clear the screen. 2.[3%] Ask the user to input three floating point numbers which are a, b, and c: Enter a: … Enter b: … Enter c: … 3. [15%] Compute a+b*c and show it: a+b*c = … 4. [1%] Press a key to go back to the main menu … means: the input value or the calculated value

5 Option Two: Simple control Use a random number generator to produce the colors of a bitmap (60x20). Control the bitmap to move. Draw the bitmap inside the area bounded by a frame. The background color is gray. -Use Randomize (set a seed) -Use random32 (return a random number between 0x0 and 0xffffffff) Key usages: ‘m’: build a new bitmap using a different seed. ‘w’: change the top row of the bitmap to gray color. The top row is deleted. ‘s’: change the bottom row of the bitmap to gray color. The bottom row is deleted. ‘a’: change the left column of the bitmap to gray color. The left column is deleted. ‘d’: change the right column of the bitmap to gray color. The right column is deleted. ‘h’: show/hide the frame. ‘q’: show student information ……

6 Option Two: Simple control 1. [1+9%] Clear the background to gray. Draw a blue frame (at least 60x20 ). 2. [0%] Call Randomize to set a seed for the random number generator. 3. [15%] Call Random32 to compute colors of the bitmap. The colors should not be gray. Draw the bitmap inside the area bounded by the frame. 4.[4*10%] Press wasd to change rows or columns of the bitmap to gray color, based on the key usages. In other words, the row or column is deteted. If you keep on to press these keys, the bimap disappears at the end. The region bounded by the frame becomes gray. 5. [5%] press ‘m’ to reset the bitmap with different colors. 6. [5%] press ‘h’ to show/hide the frame. 7. [5%] Press ‘q’ to clear the screen and then show student ID, name and email address. After that press a key to quit the program.

7 End. Enjoy programming.


Download ppt "Quiz. Quiz Three Type your name, ID and email address in the.asm file. MUST DO. If not, you will receive a score of zero. Change the folder name to yourStudentID_q3."

Similar presentations


Ads by Google