Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question: Read a sentence with period at the end. Display the sentence so that all vowels are in uppercase

sample I/O

Enter a sentence: proud is self-respect.

Output: prOUd Is sElf-rEspEct.

I have written a c++ code for this, I need to translate that to assembly language, we use c++to implement the assembly language. I have written some code for transferring a and e to uppercase, but still get wrong, can you help me with that? Thanks!

c++:

#include

#include

using namespace std;

 

char a[50];

int i;

 

void read() {

cout << "Enter a sentence: ";

cin.get(a, 50);

}

void display() {

for (int i = 0; i < 50; i++) {

if (a[i] == 'a') {

a[i] = 'A';

}else if (a[i] == 'e') {

a[i] = 'E';

}else if (a[i] == 'i') {

a[i] = 'I';

}else if (a[i] == 'o') {

a[i] = 'O';

}else if(a[i] == 'u') {

a[i] = 'U';

}

}

 

my assembly code:

char a[50];

int i;

 

void read() {

cout << "Enter a sentence: ";

cin.get(a, 50);

}

void toUppercaseA() {

a[i] = 'A';

}

 

void toUppercaseE() {

a[i] = 'E';

}

void display() {

cout << a << endl;

}

 

int main() {

_asm {

call read;

mov i, 0;

forloop:

mov eax, i;

//mov eax, i;

cmp i, 3;

jg endloop;

cmp [a + eax], 'a';

je uppercaseA;

cmp [a + eax], 'e';

je uppercaseE;

inc i;

jmp forloop;

uppercaseA:

call toUppercaseA;

jmp forloop;

uppercaseE:

call toUppercaseE;

jmp forloop;

endloop:

call display;

}

system("pause");

return 0;

}

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93113427
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question? 


Related Questions in Computer Engineering

Suppose a bowl has 5 chips 2 chips labeled 2 and 3 chips

Suppose a bowl has 5 chips; 2 chips labeled "2" and 3 chips labeled "3". Suppose 2 chips are selected at random without replacement. Let random variable X equal the product of the two draws (e.g. if the first draw is a 2 ...

Question need two different postsresponses with 200 words

Question: need two different posts(responses) with 200 words each on the below topic. There are three levels of management hierarchy: strategic, managerial and operational. Part 1: Review at least 4 academically reviewed ...

Qestion what is your understanding of the term computer

Question: What is your understanding of the term "computer"? Why do we call it computer? Is that what it does? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA ...

Bierco is a beer company based in germany you purchased the

BierCo is a beer company based in Germany. You purchased the stock in 2011 for 100 Euros when the exchange rate was 1.4 EUR/ USD. Today BierCo's price is 120 Euros and the exhange rate is 1.12 EUR/USD. What is the dollar ...

Question suppose a problem can be solved with two different

Question : Suppose a problem can be solved with two different algorithms, A or B. Algorithm A has a time complexity of TA = 17n, and algorithm B has a time complexity of TB = 0.5n 2 . Give the range of n for which it is ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

What are the possible products when solutions of kbr and

What are the possible products when solutions of KBr and Sr(NO3)2 are mixed? And what is the identity of the precipitate.

Explain the difference between penetration tests and

Explain the difference between penetration tests and security tests. Emphasize that this book will explain things from a security testing perspective.

Please explain to me the concept of policing with emphasis

Please explain to me the concept of policing with emphasis on the "leaky bucket" mechanism

Question suppose you wish to encrypt the messsge beyonce

Question : Suppose you wish to encrypt the messsge BEYONCE using the one time pad with the key RIHANNA. What is the keyspace of the one-time pad for a ciphertext of length L? Justify.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As