Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

so my code works in shell but doesn't work in pico c++ editor .cpp compiler these are the errors i get: top_div_array.cpp:81:71: missing terminating

so my code works in shell but doesn't work in pico c++ editor .cpp compiler

these are the errors i get:

top_div_array.cpp:81:71: missing terminating " character top_div_array.cpp:82:2: missing terminating " character top_div_array.cpp: In function `void print_result(float*, std::string*, int)': top_div_array.cpp:82: error: syntax error before string constant gen242@cs04:~>

and this is my code:

//poonam patel //cs 102 spring //calculates highest divisions sales using array and prototypes function

//libraries #include #include #include using namespace std; //function prototypes void populate_div_sales(float[], string[], int); int findHighest (float[], int); void print_result(float[], string[], int); int main() { int top_div_index = 0; float div_sales[4]; string div_regions[4];

//arrays for regioons div_regions[0] = "Northeast"; div_regions[1] = "Southeast"; div_regions[2] = "Northwest"; div_regions[3] = "Southwest";

//function populate_div_sales(div_sales,div_regions,4); //debug cout<<"debug print for array div_sales_array"<

cout<>sale; if(sale>=0) { f_div_sales[i]=sale; break; } else { cout<<"sale should be positive integer, please try again... "; } } } } //findinghighest int findHighest(float sales[], int size) { float greatestSalesAmount=0; int save_index=0;

greatestSalesAmount=sales[0]; for(int i=0; igreatestSalesAmount)

{

greatestSalesAmount=sales[i]; save_index=i; } } return save_index; } //printresults void print_result(float f_sales[], string f_divisions[], int size) { int highest=findHighest(f_sales,4); cout<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions