Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

You are requested by a SuperStore (Spar) in Soshanguve to calculate it’s earning for the week (the

store opens the entire week) and determine the day with the highest and lowest earnings. The

Store comprises of two sections namely the Food section and the Liquor store.

Your C++ program should prompt the total sales for each section for each day and store the

total sales for the day into an array. At the end of the week It should display a report for

Management for the total sales for that week, the day the lowest sales and the day with the

highest sales were recorded. Refer to below screen shot for sample Input and Output.


You are requested by a SuperStore (Spar) in Soshanguve to calculate it’s earning for the week (the store opens the entire week) and determine the day with the highest and lowest earnings. The Store comprises of two sections namely the Food section and the Liquor store. Your C++ program should prompt the total sales for each section for each day and store the total sales for the day into an array. At the end of the week It should display a report for Management for the total sales for that week, the day the lowest sales and the day with the highest sales were recorded. Refer to below screen shot for sample Input and Output

You are requested by a SuperStore (Spar) in Soshanguve to calculate it’s earning for the week (the

store opens the entire week) and determine the day with the highest and lowest earnings. The

Store comprises of two sections namely the Food section and the Liquor store.

Your C++ program should prompt the total sales for each section for each day and store the

total sales for the day into an array. At the end of the week It should display a report for

Management for the total sales for that week, the day the lowest sales and the day with the

highest sales were recorded.


11. Given the array weekdays, what is the data type of the array considering the elements?

a. string

b. double

c. real

d. int


12. The position of an element in array is called a transcript

a. True

b. False


13. An array can store a group of values, but the values must be:

a. The same data type

b. Each of different data type

c. Constants

d. Integers

14. A one-dimensional array can be seen as a single column with just one row or a single row with single column

a. True

b. False


6. The elements of an array can consist of multiple variables at individual times, each having a single value.

a. True

b. False


7. The elements of array are distinguished from one another by a unique index

a. True

b. False


8. An array's subscript or index always starts from 1, with the last subscript corresponding to n - 1

a. True

b. False


9. With one-dimensional arrays, programmers can write shorter and more efficient code, while still providing the read-in data after the array has been read.

a. True

b. False


10. Given a one-dimensional array of weekdays: weekdays(7), what is the fourth index element?

Monday Tuesday Wednesday Thursday Friday Saturday Sunday

a. Friday

b. Thursday

c. Saturday

d. Sunday




1. Grade [2] refers to a third value stored in an array

a. True

b. False 


2.Which of the following is a valid C++ array definition?

a. int scores[0];

b. float $payments[10];

c. int reading[4.5];

d. int scores[10];


3. The elements of an array are of different data types

a. True

b. False


4. The following declaration is valid char code[3] = {“sam”,”anna”,”max”}

a. True

b. False


5. Given the following declaration, where is the value 77 stored in the scores array? int scores[] = {83, 62, 77, 97};

a. scores[0]

b. scores[1]

c. scores[2]

d. scores[4]



You are requested by a store opens the entire week) Store comprises of two sections namely the Your in Soshanguve to calculate it SuperStore (Spar) and determine the day with the highest Food section C++ program anagement for the should prompt the total sales for each section for each day [27 ] ’ s earning for the week and lowest earning s (the .  The a nd the Liquor store . and store the total sales for the day into an array.  At the end of the week It should display a report for M total highest sales were sales for that week, t recorded.


You are given this snippet:

int main(){
    int m = 10, n = 20;
    cout << &m << endl;     // Whats is &m?
    int* ptr1 = &m;         // Explain this line.
    cout << ptr1 << endl;   // What is ptr1?
    cout << *ptr1 << endl;  // What is *ptr?
    int* ptr2 = ptr1;       // Explain this line.
    ptr1 = &n;              // Explain this line.
    cout << &ptr1 << endl;  // What is &ptr?
    return 0;
}

Please answer the questions in comments,


You are given a string str, remove all special characters from it and convert all uppercase letters to lowercase, and return the new string.

Special characters are characters that are not letters and digits.

Eg1:

Input: str = "Hello, World 2!"

Output: "helloworld2"

Hint: 1. C++ has many useful functions for this question: isupper, islower, isalpha, isdigit.

string removeSpecialChars(string str){
        
}

Flying fish can leap above or dive under the surface of the water a certain distance. You re given an array gain where gain[i] is the net gain in altitude between point i and point i+1 (please see examples). The fish always start at the water surface (altitude = 0). Return the highest altitude that the fish can reach.

Eg1:

Input: gain = {0, -5, 1, 5, 0, -7}

Output: {3, 1} or {4, 1}

Explanation: The fish start with altitude = 0, then dive -5 (altitude = 0 + (-5) = -5), then emerge 1 (altitude = -5 + 1 = -4), then emerge 5 (altitude = -4 + 5 = 1), then keep the same 0 (altitude = 1 + 0 = 1), then dive -7 (altitude = 1 + (-7) = -6).

Overall, the altitudes are {0, -5, -4, 1, 1, -6}. The highest is 1 at 3rd and 4th point.

Eg2:

Input: gain = {-4, -3, -2, -1, 4, 3, 2}

Output: {0, 0}

Explanation: The altitudes are {0, -4, -7, -9, -10, -6, -3, -1}. The highest is 0.

vector<int> flappyFish(vector<int> gain){
        
}




LATEST TUTORIALS
APPROVED BY CLIENTS