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
timurjin [86]
3 years ago
8

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.

after the loop terminates , it prints out, separated by a space and on a single line, the sum of all the even integers read and the sum of all the odd integers read. declare any variables that are needed. assume the availability of a variable , stdin, that references a scanner object associated with standard input.
Computers and Technology
1 answer:
zysi [14]3 years ago
5 0
Procedure SumEvenOdd(stdin: array [0..100] of integer)
var
   i, sum_even, sum_odd: integer;

begin
   for i := 0 to 100 do begin
       if stdin[i] < 0 then
           break;
       if stdin[i] mod 2 = 0 then //even number
          sum_even := sum_even +  stdin[i]
       else 
          sum_odd := sum_odd +  stdin[i]; 

       ShowMessage('sum of even is ' + IntToStr(sum_even) + ' ' + 'sum of odd                                  is' + IntToStr(sum_odd) ) ;
   end; 

end
You might be interested in
What are the four conditions to help determine whether a website is a good source for information?
Ratling [72]

Answer:

1. Credible Websites are Registered with Legitimate Institutions 2. Watch out for Dummy Content for Website Credibility Check 3. Watch out for Scam Advertisements to Verify Website Credibility 4. Professional Designs Mean Everything

Explanation:

3 0
1 year ago
When C++ is working with an operator, it strives to convert operands to the same type. This is known as
ziro4ka [17]

Answer:

The answer is "Option B"

Explanation:

Conversion of type is a way of changing an entity from one data type to another. It is used to make the variable process properly by a function in computer coding.  

In the C++ language, the result of the multitype value added or any other option is the result between those variables as a large type at that time, that's why choice b is correct.

7 0
2 years ago
A(n)<br> is a fast compute with lots of storage. pls help
Pachacha [2.7K]

Answer:

Surface Laptop 3 - 15", Platinum (metal), AMD Ryzen 5 3580U, 8GB, 128GB

4 0
3 years ago
Read 2 more answers
When the computer begins to run a program
Ne4ueva [31]

Answer:

1.the program is moved from secondary storage to memory.

Explanation:

Secondary storage media generally have greater storage capacity than RAM (random access memory), for this reason the data and program are stored there.

but ram memories are much faster, for example, a solid state disk (SSD) with SATA III connection can have read and write speeds of approximately 500 MB/s, while a DDR III RAM can have speeds between 12 and 18 GB/S, that is, more than 20 times faster.

 So that the flow of data at the time of running a program is optimal, the data from the secondary storage unit is copied to the RAM and this ensures that the speed at which the programs run is at least 20 times faster, and our processes run better.

7 0
2 years ago
TVBCA has just occupied an old historic building in downtown Pittsburgh in which 15 employees will work.
7nadin3 [17]

Answer:

A. The proposed solution delivers the required result and both optional desired results.

Explanation:

The IEEE 802.11a is the standard code of the wireless communication technology known as WIFI, it is wireless as it requires no cable to connect to a network device. The data transmission rate of the IEEE 802.11a is 1.5 - 54Mbps (mega bit per second). So, the employees in the TVBCA building can wireless connect to the network, which allows them to be mobile and they can also send large CAD files among themselves.

6 0
3 years ago
Other questions:
  • While moving into a new apartment, Titus needed to hold the door open with something heavy. It suddenly dawned on him that he co
    9·1 answer
  • A.<br> Post-It note<br> b.<br> notebook<br> c.<br> tutor<br> d.<br> spell check
    14·1 answer
  • Plane eyes I don't know
    9·1 answer
  • Of the key reasons for creating organizational units which of the following is not one of them?
    13·1 answer
  • Hi I m from India plz follow me and I will follow u​
    15·2 answers
  • Draw the hierarchy chart and then plan the logic for a program that calculates a person’s body mass index (BMI).
    11·1 answer
  • How is kerning used in Word?
    7·2 answers
  • In a gear system, when you gain torque you lose what?
    11·1 answer
  • Remember that kid who would always ask you for your food, even though he packed his own lunch.
    8·2 answers
  • 1. Fill in the blanks:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!