ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 06 May 2017 My Price 8.00

C++ code, improve the code by eliminating length calls out of the loop

Given the following C++ code, improve the code by eliminating length calls out of the loop, put most used variables first when initializing variables, use prefix operators rather than postfix operators, loop unrolling, and any other improvements you would like to make to improve performance. Please note, the order of the output is not important, all data should be output.

 

 

#include

#include

#include

using namespace std;

 

 

int main(int argc, char* argv[])

{

double sum=0;

vector speed;

vector ship;

vector pilot;

 

speed.push_back(12.0);

ship.push_back("Millenium Falcon");

pilot.push_back("Han solo");

speed.push_back(15.5);

ship.push_back("Viper");

pilot.push_back("Kara Thrace");

speed.push_back(22.0);

ship.push_back("Serenity");

pilot.push_back("Malcolm Reynolds");

 

for(int i=0; i {

cout cout cout cout cout

 

 

 

return 0;

}

Answers

(11)
Status NEW Posted 06 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)