首页 > > 详细

辅导留学生C/C++、C/C++讲解、辅导留学生C/C++设计、Topic Practical Assignment 程序调试

Topic Practical Assignment 3
Assignment
1. Assignment
Write a program in assembly that:
1. Prompt the user to input a number between ‘2’ to ‘5’, which is used to run a loop counter, i.e.
counter.
2. Run the loop to read in a series of positive integers and allow the user to terminate the loop
when he/she enters any negative integer.
3. When the program terminates, print out an exit and number of loops message.
4. Sort the numbers from lowest to highest then print out the results.
5. Add all the numbers and print out its total, i.e. totalAmt.

2. Learning Outcome
1. To understand the components of a computer system, their functions, and interactions.
2. To develop inline assembly programming skills.

3. Requirements and Assessment
Your program MUST be developed using Visual C++ inline assembly language.
1. Your program can compile and run. (10 marks)
2. Run a loop based on counter and ensure the input is a positive integer. Should the user input
a negative integer, exit the program. (10 marks)
3. Print out an exit and number of loops message. (5 marks)
4. Print out the series of positive integers that have been entered, starting from the lowest to the
highest. (10 marks)
5. Print out the series total, i.e. totalAmt. (5 marks)
6. Well-commented, stapled program listing for your solution. (60 marks)

4. Sample Output
A sample output from the program is shown below.
Select total number of positive integers (between 2-5): 5
Enter positive integer 1: 67
Enter positive integer 2: 13

Department of Computer Science and Software Engineering

Enter positive integer 3: 21
Enter positive integer 4: 39
Enter positive integer 5: -9
Program terminates and has looped 4 times.
Your integers from lowest to highest is 13, 21, 39, 67
The total amount is 140

5. What to do during the assessment upon the due date?
1. Sign for attendance at the pre-scheduled assessment timeslot.
2. Demonstrate and explain to the lab demonstrator that your program works for the problem
assigned.
3. Hand in a well-commented, stapled program listing with the module title and your
name/student number shown on the title page. Your program listing should not exceed 4 pages.
4. You must also sign and declare non-plagiarism.

---------- End of Document ----------
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!