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

  Make a `show me'' button that displays the number

Write down a GUI program that is a game to be played by the user. A new employee is working on a classified mission and the program will randomly pick an expected profit to be guessed by the user. The program must randomly select a number within r..

  Create an unsorted array list with 100 random items

Create an unsorted array list with 100 random items in it and then perform a linear search on the array list looking for an item that is present in the list.

  Implementing mutually exclusive access to a critical section

Implementing mutually exclusive access to a critical section using binary semaphore. Implementing mutual exclusion using monitor called by processes competing.

  Write digraph methods called read

Write Digraph methods called read that will read from the terminal the number of vertices in an undirected graph and lists of adjacent vertices.

  Solve problems in logic and describe the early machines

Describe some of the early machines devised to solve problems in logic, such as the Stanhope Demonstrator, Jevons's Logic Machine, and the Marquand Machine.

  Modify the implementations of the classes in the atm

Modify the implementations of the classes in the ATM example so that the bank manages a collection of bank accounts and a separate collection of customers. Allow joint accounts in which some accounts can have more than one customer.

  Explain the behavior of an input element with the email type

Explain the behavior of an input element with the email type. What is the purpose of the placeholder attribute of an input element?

  Identify the geopolitics of key nations

Create a 1-page, 4-row by 3-column table in Microsoft® Word that depicts laws for the U.S. and two other key nations in the strategic, tactical.

  Begin the writing process you are going to compare the

for the final paper you will select one topic from the list below.nbsp choose a topic that is important or

  Questionthe school course catalog reads as follows to enrol

questionthe school course catalog reads as follows to enrol in mgt 580 that is an advanced course a student must

  Clearly describe the information security issue

Clearly describe the information security issue, Provide a discussion of the cultural/contextual issues associated with the information security issue

  A gui application where the user enters the wholesale cost

Create a GUI application where the user enters the wholesale cost of an item and its markup percentage into text fields.

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