1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DerKrebs [107]
3 years ago
8

You can get context-sensitive help information from the code editor by

Computers and Technology
1 answer:
Drupady [299]3 years ago
8 0
Visual Studio* IDE Code Editor.
You might be interested in
Raj’s computer just crashed and he lost most of his files. What should he do to avoid this problem in the future?
Elanso [62]
He should back up his data regularly
3 0
4 years ago
Read 2 more answers
When you select Insert and click on a shape the mouse pointer turns into a/an
Gennadij [26K]

It turns into crosshairs

6 0
3 years ago
Read 2 more answers
Which of the following is an extension of the fill pattern Sunday,Tuesday?
Maru [420]
The answer to your question is Thursday, Saturday, Monday.
7 0
3 years ago
Add me as a friend on Real pool 3D so we can play a round of pool!!!
Sloan [31]

I will but i have to wait till after 3;00 will you still be online by then. If not you can just friend me and message me when you are today

8 0
3 years ago
For a set of integers stored in an array,calculate the sum of the positive numbers and the sum of the negative numbers. The prog
Radda [10]

Answer: The c++ program to implement the given conditions is shown below.

#include <iostream>

using namespace std;

int main()

{

// used as index of array in the loop for calculating the sum

   int i=0;

// array contains both negative and positive integers

// 0 is used as the sentinel value

   int arr[12]={-9,-8,-3,-12,-78,-10,23,45,67,1,0};

   int positiveSum=0, negativeSum=0;

   do

   {

       if(arr[i]<0)

           negativeSum = negativeSum + arr[i];

       if(arr[i]>0)

           positiveSum = positiveSum  + arr[i];

// after every element is added, index of array represented by i is incremented

       i++;

   }while(arr[i]!=0);

// loop continues till end of array is reached

   cout<<"Sum of positive integers "<<positiveSum<<" and sum of negative integers "<<negativeSum<<endl;

   return 0;

}

OUTPUT

Sum of positive integers 136 and sum of negative integers -120

Explanation: This program declares and initializes an integer array without user input. As mentioned in the question, 0 is taken as the sentinel value which shows the end of data in the array.

   int arr[12]={-9,-8,-3,-12,-78,-10,23,45,67,1,0};

All the variables are declared with data type int, not float. Since, integers can yield integer result only.

The do-while loop is used to calculate the sum of both positive and negative integers using int variable i. The variable i is initialized to 0.

This loop will run till it encounters the sentinel value 0 as shown.

while(arr[i]!=0);

Hence, all the integers in the array are read one at a time and sum is calculated irrespective of the element is positive or negative.

       if(arr[i]<0)

           negativeSum = negativeSum + arr[i];

       if(arr[i]>0)

           positiveSum = positiveSum  + arr[i];

After the element is added, variable i is incremented and loop is continued.

The do-while loop tests positive and negative integers based on the fact whether their value is greater than or less than 0.

The program can be tested using different size and different values of positive and negative integers in the array.

7 0
4 years ago
Other questions:
  • Write a program that calls fork(). Before calling fork(), have the main process access a variable (e.g., x) and set its value to
    5·1 answer
  • Write an expression that concatenates the string variable suffix onto the end of the string variable prefix .
    15·2 answers
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? I need the answer ASAP Helping com
    14·2 answers
  • Charlie is a British national who works in the United States as a novelist for children. Because he is British, he types the wor
    10·2 answers
  • Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
    14·1 answer
  • Which remote access configuration option should you choose if you want mobile users to be able to make a secure connection to th
    9·2 answers
  • The __________ format is a proprietary file format defined by guidance software for use in its forensic tool to store hard drive
    15·1 answer
  • What are some real-life situations where multi-dimensional arrays might be useful?
    8·1 answer
  • Say true or false. a)ICT in education is used as teaching learning aid
    9·1 answer
  • Tools such as microsoft's word, excel, and powerpoint are examples of ________ software. question content area bottom part 1 a.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!