Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the code in Visual Studio so when the user enters a number for their age below 5, the program prints out a message Wow!

Modify the code in Visual Studio so when the user enters a number for their age below 5, the program prints out a message Wow! That young, yet you know how to use a computer!. image text in transcribed

TITLE Dog years (demo1. asm) ; Description: This program gets the age of the user and calculates their age in dog years (age x 7). INCLUDE Irvine 32.inc .data DWORD age hi_there prompt1 output byebye BYTE BYTE BYTE ? "Hi there, this is John", o "Can I have your age please?",0 "So, your age in dog years is: ",0 "Thanks for passing by, have a great day!",0 ; User's age ; Greeting the user ; Gets age ; Reposts dog age ; Bye bye ; Set up for call to WriteString and greet the user .code main PROC ; Greet the user mov EDX, OFFSET hi_there call WriteString call Crlf ; Gets the user's age mov EDX, OFFSET prompt1 call WriteString call Crlf call ReadInt call Crif ; Asks the user's age ; Reads the users age. Age in EAX ; Calculate the dog years and stores the dog age mov EBX, 7 mul EBX mov age, EAX ; Stores the users dog age. Dog age also in EAX ; Reports the dog years and says bye mov EDX, OFFSET output call WriteString mov EAX, age call WriteDec call Crlf mov EDX, OFFSET byebye call WriteString call Crif exit ;exit to operating system main ENDP END main TITLE Dog years (demo1. asm) ; Description: This program gets the age of the user and calculates their age in dog years (age x 7). INCLUDE Irvine 32.inc .data DWORD age hi_there prompt1 output byebye BYTE BYTE BYTE ? "Hi there, this is John", o "Can I have your age please?",0 "So, your age in dog years is: ",0 "Thanks for passing by, have a great day!",0 ; User's age ; Greeting the user ; Gets age ; Reposts dog age ; Bye bye ; Set up for call to WriteString and greet the user .code main PROC ; Greet the user mov EDX, OFFSET hi_there call WriteString call Crlf ; Gets the user's age mov EDX, OFFSET prompt1 call WriteString call Crlf call ReadInt call Crif ; Asks the user's age ; Reads the users age. Age in EAX ; Calculate the dog years and stores the dog age mov EBX, 7 mul EBX mov age, EAX ; Stores the users dog age. Dog age also in EAX ; Reports the dog years and says bye mov EDX, OFFSET output call WriteString mov EAX, age call WriteDec call Crlf mov EDX, OFFSET byebye call WriteString call Crif exit ;exit to operating system main ENDP END main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions