Create functions and put all the code in the main

Assignment Help Computer Engineering
Reference no: EM132105089

PROBLEM

TresKom was hired by the previous government to account for expenses in the Choliseo VIP lounge. The new government of the republic, made up of engineers with impeccable behavior wants to improve the code of TresCom engineers. However, the TresCom engineers were so inept that they did not create functions and put all the code in the main. We hope you do the work as it should have been done in the beginning!

1. Move lines 11 to 14 to a function that will be called verificaMemory.

2. Move lines 16 to 20 to a function that will be called readComilona (keywords: comilona = abundant food accompanied with expensive wines and incredible desserts. Corrupt = politician).

3. Move lines 22 to 27 to a function that will be called PrintComilonayTotal.

4. In the PrintComilonayTotal function, in addition to printing the comilonas, you must calculate and print also the total amount of money spent on the comilonas (the total).

CODE

//3Com.Enaudi.inc todos los torcidos corruptados
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
float *gastos;
int numOfgastos;
cout << "Entre el numero total de fiestas: ";
cin >> numOfgastos;
gastos = new float[numOfgastos];
if (gastos == NULL){
cout << "Eror allocating memory, bye!!!";
return -1;
}
cout << "Entre la factura de su comilona corrupta\n";
for (int i = 0; i < numOfgastos; i++){
cout << "Leyendo Comilona " << i + 1;
cout << " en posicion de memoria: " << gastos + i << " : ";
cin >> *(gastos + i);
}
//Display gastos to verify they are inside the computer
for (int i = 0; i < numOfgastos; i++) {
cout << "\nComilona numero " << i + 1;
cout << " en direccion de memoria: " << gastos + i;
cout << " con valor de: ";
cout << *(gastos + i);
}
delete[] gastos;
return 0;
}

Reference no: EM132105089

Questions Cloud

When reviewing the progress of a project : When reviewing the progress of a project, why is it important that the quality control reviews be properly documented?
Advantages and disadvantage of self-checking : When monitoring the progress and quality of a project, a team member could be using self-checking as a quality control method over, say, a team leader review.
Leadership traits-competencies : What do you think are the most critical roles a project manager has to play as well as leadership traits/competencies needed to be successful?
Major energy pathways : With examples identify a sport athlete that uses each of the three major energy pathways.
Create functions and put all the code in the main : TresKom was hired by the previous government to account for expenses in the Choliseo VIP lounge.
Differences between scrum roles and traditional project role : What are the most important differences between scrum roles and traditional project roles? What is the MoSCoW technique and how it is used?
Project to be effective and successful : What are 2 qualities that you think are essential for the project manager to have for this project to be effective and successful?
Identify the principal domain entities : A bank has several automated teller machines (ATMs) that are geographically distributed and connected via a wide area network to a central server.
Preference of accrual basis of accounting : What rationale is adopted to preference of accrual basis of accounting over cash basis?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determine the main purpose of a contingency plan and when

write 400-600 words that respond to the following questions with your thoughts ideas and comments. this will be the

  Prepare an html document that describes an ordered list

Prepare and test an HTML document that describes an ordered list with the following contents: The highest level should be the names of your parents.

  Q1 design a digital chebyshev-ii filter that satisfies the

q.1 design a digital chebyshev-ii filter that satisfies the following

  Define how does a cikr vulnerability assessment

How does a CIKR vulnerability assessment differ from a risk assessment

  Define the processor would then encrypt the results

The processor would then encrypt the results. How would such a processor be useful. What are the design requirements for such a processor

  Remove all branches from the list so that you can run mkdir

Create a directory list from bar1 with find and order it if necessary. Remove all branches from the list so that you can run mkdir only on the leaves.

  How can ms-isac help state and local governments

Does MS-ISAC Reduce Risks? Answer the following: Is there a benefit to working with MS-ISAC, How can MS-ISAC help state and local governments.

  Some it department policies are designed to prevent

some it department policies are designed to prevent behaviors by it staff. while some depend upon the employee

  Create an application that lets user enter number of books

Create an application that lets the user enter the number of books that he or she has purchased this month and displays the number of points awarded.

  Change the image to a black-to-green scale image

Call a method that will change the image to a "black-to-green scale" image - Call a method that will change the image to a version of a green scale image.(green to white).

  In short describe the situation inside your company

It is likely that your organization uses various decision-support programs, as in  programs that automate production, programs for resource optimization, and so on.

  Explain the principles of siem

Topic: Identify And Describe SIEM Content: Each suggested topic below should be a Heading 2 paragraph (you should have at least 6 topics)

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