Question: Complete the following tasks for the trial program. 1. Display your full name. 2. Display your MMU student ID. 3. Allow user input with


Complete the following tasks for the trial program. 1. Display your full name. 2. Display your MMU student ID. 3. Allow user input with four decimal digits in a range of 0000 to 2500. The digits signify energy consumed in a certain month in kWh. 4. Calculate the charges according to the following tariff rate: Tariff Category First 1000 kWh 1001kWh and beyond Rate RM0.01/kWh RMO.20/kWh 5. Display the bill amount. EXAMPLE 1 emulator screen (659 chars) Name: John Smith Student ID: 12345678 Energy usage in khh (enter decimal digits 0000 to 2500): 1500 Bill amount : RM110.00 change fort Calculation: Bill amount = 1000 (1 cent) + 500 (20 cents) = 11000 cents = RM110.00 EXAMPLE 2 emulator screen (63x7 chars) Name: John Smith Student ID: 12345678 Energy usage in khh (enter decimal digits 0000 to 2500): 2041 Bill amount: RM218. 20 clear screen change tort Calculation: Bill amount = 1000 (1 cent) + 1041 (20 cents) = 21820 cents = RM218.20 EXAMPLE 3 Bemulator screen (638 chars) Name: John Smith Student ID: 12345678 Energy usage in khh (enter decimal digits 0000 to 2500): 0385 Bill amount : RM3.85 change font clea screen Calculation: Bill amount = 385 (1 cent) = 385 cents = RM3.85 Additional material: Following is a code snippet to perform hexadecimal to decimal conversion and store the result in ASCII. You may use / modify it or use your own code. MOV AX. 1500 : 1500 - SDCH Hex to decimal Store in memory in ASCII format MOV CX.8 MOV DI.200H offset for menory location Initialize start of memorY location nitialize divider to perfore hex to dec conversion Quot ient= A8i, Remainder = DX Convertie ASCII format Save ASCII code in memory CONT: OR 30H CMP AX.2. INIS Check If quot ient is zero iEnsure DX-0 for the next iteration JAP CONT FINISH: A screenshot halfway through first iteration: Final memory content: Tandom A ary tabe wpdate 0709: 9299 0051 TITI ASCII Character ASCII Character 30 35 1 31 6. 36 2 32 37 33 8. 38 4 34 6. 39
Step by Step Solution
There are 3 Steps involved in it
PART A and PART B Both these parts basically require a string being printed so they have been ma... View full answer
Get step-by-step solutions from verified subject matter experts
