Display the sentence so that all vowels are in uppercase

Assignment Help Basic Computer Science
Reference no: EM132125961

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 <iostream>

#include <string>

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;

}

 

Reference no: EM132125961

Questions Cloud

Discuss the importance of metadata : Discuss the importance of metadata and some of the various ways (Microsoft) SQL Server allows you to expose that information.
Identify the strategic issues : Conduct strategic analyses: Identify the Strategic Issues. Each issue can be summarized in 1-2 sentences.
Develop a logical model of the registration system : If you were asked to develop a logical model of the registration system at a school, would it be better to use a top-down or bottom-up approach?
Explain data-information and knowledge with examples : Explain data, information, and knowledge with examples. Make sure to clearly identify the differences between the terms.
Display the sentence so that all vowels are in uppercase : Question: Read a sentence with period at the end. Display the sentence so that all vowels are in uppercase
Describe the responsibilities of management for errors : This assignment is critical for students to gain a fundamental understanding of management's and auditor's responsibility for detecting errors.
Analyze public health communication via social media : Public Health Communication and Social Media - Describe the benefits/advantages and challenges/risks of using social media for public health communication
Record the transactions in the desired manner : Record the following transactions in the desired manner and give the adjusting entry on December 31, 2017. (Two entries for each part.)
Identify two scheduling techniques : Identify two scheduling techniques that might be used effectively for this project with the advantages and disadvantages of each.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Horizontal demand curve

Explain why a firm with market power faces a downward sloping demand curve, while a perfectly competitive firm faces a horizontal demand curve.

  Develop a new centralized system

A text message to customers who are overdue for more than 3 days is generated every day. The current system is run on old standalone PCs that are not connected in a central system. The owner of the company requested a software expert to develop a ..

  The table number and waiter''s name must be entered

o The table number and Waiter's name must be entered. The restaurant has only 10 tables, therefore, the only valid table numbers are 1-10. After the user enters the table number and waiters name, then the table number and the waiters name shou..

  Purpose of the software engineering institute

Explain in your own words the purpose of the Software Engineering Institute's (SEI) exercises regarding team communication, and determine whether or not you believe this type of testing and analysis is a beneficial use of resources. Justify your a..

  Explain reads and writes using lipner-s matrix

Who in Lipner's model can make this change? Explain the reads and writes necessary to make this change and justify the read and write using Lipner's matrix.

  Flowchart that models a complete java program

Using the draw.io site or a flowcharting tool of your choice, create a flowchart that models a complete Java program called StringSlicer that uses methods to:

  Why supply-demand-equilibrium price different in short term

Price of product in short-term and long-term also describe why you believe supply, demand, or equilibrium price will be different, if at all, in short-term and long-term.

  Create an html file that displays that information

Write a Windows application to make a user interface to allow users to choose what information from the anAuthorStyle.xml XML document to display

  Classes that the equivalence relation defines

Describe the equivalence classes that the equivalence relation defines.

  Crash the completion time to the minimum level

The following project network and table provide the normal times and costs as well as the crash times and costs for the activities required to complete a project. Crash the completion time to the minimum level.

  What are the most important issues to consider

What are the most important issues to consider? Support your answer with web research on these issues.

  How many different t-shirts are there to choose from

A wholesale T-shirt company offers sizes small, medium, large, and extra-large in organic or non-organic cotton and colors white, black, gray, blue, and red.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd