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
Pda bkhhksejc pnwjoynelp dwo xaaj ajykzaz ywj ukq zaykza ep???<br><br><br> The Key Value is 22
Sindrei [870]

Answer:

The following transcript has been encoded can you decode it???

Explanation:

It is a ceasar cipher. Shift every letter in the alphabet by 22 positions.

3 0
3 years ago
Which are advantages of using a server operating system?
iogann1982 [59]

Answer:

Extra security features and networking services built right in

Explanation:

The major advantage of using a server operating system is that it has decent security features and networking services built right in it from the default settings

8 0
2 years ago
Do you know how i can text my mom (and tell my mom to tell dad) that i want to get a new phone and get my ipad back without it b
posledela

You can clean your room, do chores without being told, and being nice to your siblings, or being very helpful around your house. I don't have social media myself, but from what I know, you just have to follow the directions correctly on the site or ask a friend. Plze mark me brainiest:) Hopefully this was helpful:)

7 0
3 years ago
A device that modulates digital data onto an analog signal and then demodulates the analog signal back to digital data is a ____
LenKa [72]
A modem. (From modulator-demodulator)
5 0
3 years ago
How would I CAST this variable to a STRING?<br> teeth = 32
maria [59]

Answer:

By using the str() function.

teeth = 32

print(str(teeth))

Explanation:

The str() function returns the string version of the given object.

4 0
3 years ago
Other questions:
  • A game’s ______ is what contains its directions and calculations; some refer to it as the “engine” that drives the game.
    12·1 answer
  • Which type of malware can hijack internal windows components and often goes undetected because it is already loaded when the ant
    14·1 answer
  • In a Comparative Government course, the first unit focuses on the US Congress and the
    8·1 answer
  • Name three types of hard drives, along with its speed and size.
    8·1 answer
  • What is the most effective way to demonstrate being prepared for an interview?
    13·1 answer
  • One can find mountain ranges, elevation levels, and deserts on a physical map.
    15·2 answers
  • 3.6 Code Practice Edhesive. (PYTHON LANGUAGE)
    13·1 answer
  • A man-in-the-middle attack or impersonation are likely to result in problems with
    12·1 answer
  • Being a part of an organization or giving back to the community is which rewards of work factor?
    6·1 answer
  • mary has access to certain resources because she is in the Research division of her company. She has access to other resources b
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!