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
When you save a drawing using paint, it's automatically stored as a?
serious [3.7K]

Answer:

Bitmap File

Explanation:

6 0
3 years ago
What should you do if ads keep popping up on your computer when using Google Chrome?
romanna [79]
I think it’s B.. I’m pretty sure
8 0
3 years ago
Technician A says that reprogramming a PCM using the J2534 system requires a factory scan tool, while Technician B says it requi
Dmitry [639]

Answer:

Technician B only

Explanation:

6 0
2 years ago
Ethan is responsible for writing the dialogue in a movie. Which role is he playing? Ethan is playing the role of a(n).....''BLAN
iVinArrow [24]
Screenwriter! A screenwriter's role is to pen the script for a film.
3 0
3 years ago
giving Brianlist (to the correct answers)help plesee question is what is keyboard (long paragraph)​plzz don't spam with unnecess
Ira Lisetskai [31]

Answer:

Explanation:

A computer keyboard is an input device that allows a person to enter letters, numbers, and other symbols (these are called characters in a keyboard) into a computer. Using a keyboard to enter lots of data is called typing. A keyboard contains many mechanical switches or push-buttons called "keys".

7 0
3 years ago
Other questions:
  • When reading data across the network (i.e. from a URL) in Python 3, what string method must be used to convert it to the interna
    9·1 answer
  • Which is the common name for a program that has no useful purpose, but attempts to spread itself to other systems and often dama
    14·1 answer
  • Design a module named getNumber, which uses a reference parameter variable to accept an Integer argument. The module should prom
    6·1 answer
  • Unit 3 Computer Programming Study Guide
    6·1 answer
  • In cryptography, the term "Secret algorithm" refers to an algorithm designed in a way that prevents the examination of its inner
    12·2 answers
  • Please debug the below code in Java please.
    15·1 answer
  • A reasonable documentation comment for this program might be public class Questions1_4 { public static void main(String[ ] args)
    6·1 answer
  • In an MLA style citation for an image, what information should be listed first? A. The name of the creator B. The title of the i
    8·2 answers
  • Write JavaScript code to declare a variable of the name favoriteColor
    13·1 answer
  • 1. Light of wavelength 900x10-9 m is emitted by a source. What is its frequency?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!