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

System analysis and design1 provide a scenario in which an

System Analysis and Design: 1) Provide a scenario in which an input display screen is inconsistent and explain how both the user and the organization would suffer as a result as a result. 2) Explain how structured walkth ...

Sectuon 112 build draw binary search tree with the names

Sectuon 11.2: Build draw binary search tree with the names Doc, Grumpy, Happy, Sleepy, a Bashful, Sneezy, Dopey, inserted in the order provided here. Assume that, on future searche of this tree, each name is equally like ...

The newly elected president needs to decide the remaining 4

The newly elected president needs to decide the remaining 4 spots available in the cabinet he/she is appointing. If there are 13 eligible candidates for these positions (where rank matters), how many different ways can t ...

Describe the definition of ransomware and what is wannacry

Describe the definition of ransomware. And what is wannacry threat?

Question you recently joined a local cyber security hackers

Question: You recently joined a local cyber security "hackers" group that meets once a month to discuss recent cyber security related events, as well as tools and techniques. You have offered to present at the next meeti ...

A researcher conducts a well-designed study to compare a

A researcher conducts a well-designed study to compare a sample mean to a known population mean and uses alpha=.05, two-tailed. She finds a z-test of 1.98, p-value=.048. What should she conclude? a. The 95% confidence in ...

Find minimal dfas for the following languages in each case

Find minimal dfa's for the following languages. In each case prove that the result is minimal. (1) L = {a n bm> :n≥2,m≥1}. (2)L = {a n :n ≥ 0,n ≠ 3} (3) L = {a n :n mod 3 = 0}∪{a n : n mod 5 = 1}

Explain why some organizations may not place enough

Explain why some organizations may not place enough importance on disaster recovery. What might happen to these organizations in the event of an actual disaster?

Your task is to implement the simple elevator in python

Your task is to implement the simple elevator in Python using classes. The default strategy is the simple "start at the bottom, go to the top, then go to the bottom". Can you write a better strategy one that is more effi ...

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

  • 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