cs206dco.files.wordpress.com€¦  · web viewextra example in chapter 5. q1) write assembly...

14
Extra Example in chapter 5 Q1) Write assembly program that ask user to enter the department number then display his/her department abbreviation. 1. If the user enter 1, the program will display his/her department Network Communication System (NCS). 2. If the user enter 2, the program will display his/her department Computer Science (CS). 3. If the user enter 3, the program will display his/her department Information Systems (IS). 4. If other numbers display illegal message.

Upload: vanhanh

Post on 29-Aug-2019

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Extra Example in chapter 5

Q1) Write assembly program that ask user to enter the department number then display his/her department abbreviation.

1. If the user enter 1, the program will display his/her department Network Communication System (NCS).2. If the user enter 2, the program will display his/her departmentComputer Science (CS).3. If the user enter 3, the program will display his/her departmentInformation Systems (IS).4. If other numbers display illegal message.

Page 2: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q2) Write a program to read characters until a blank/space is read

Page 3: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q3) Write a program to read characters from the user until the program reads the last previous character.

Page 4: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q4) Write a program to read characters from the user until the program reads dollar sign and after read it your program must delete it .

hint: use backspace character to delete dollar sign

Page 5: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q5) Print stars “*” a number of times, let the user enter the number of stars to be printed.

Page 6: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q6) Write program that read characters from user and count the number of characters if they reached 30 displays a message “The Program Cannot Accept Anymore Characters.”

Page 7: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q7) Write an assembly program that asks the user to enter his college year, and then display a message based on his entry. If the user enters a number more than 5 or less than 0, give him an error message.

Page 8: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department
Page 9: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q8) Write a program to asks user to enter character that he/she want to count in his/her message , after that the program reads characters from the user until the program reads dollar sign.

Page 10: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q9) Write a program to asks user to enter character and the program print "character is vowel" if the character is vowel and print "character is not vowel" if the character is not vowel

Page 11: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department

Q10) Write assembly program that asks user to enter characters until user enter number character, after that program must display first character and last character (BEFORE NUMBER) that entered and number of characters.

Page 12: cs206dco.files.wordpress.com€¦  · Web viewExtra Example in chapter 5. Q1) Write assembly program that ask . u. ser to enter the department number then display his/her department