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]
4 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]4 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
In the Unified Process (UP), related activities are grouped into UP ____. a. Services b. Disciplines c. Cycles d. Practices
Paha777 [63]

Answer:

b. Disciplines

Explanation:

The Unified Process (UP) is a type of development framework that repeats itself and can be customized and used for several different variations of the same underlying process. In the Unified Process (UP), related activities are grouped into UP Disciplines, as one of the many components that make up the Unified Process.

6 0
3 years ago
A and B have same output or not? A B x=0 x=0 do do x&lt;3 x=x+1 x=x+1 print x print x while x&lt;3 while
katen-ka-za [31]

Answer:

A and B have different output:

A output will be 1

B output will be 123

Explanation:

A

X = 0

do x < 3

x = x+1

print x

while

B

X = 0

do x = x+ 1

print x

while x < 3

For statement A the condition statement which suppose to be after "while" is not set therefore the value of x will be printed.

For statement B the condition statement is set "x < 3" in front of "while" thereby result in iteration until the condition is false.

Statement A output will be 1

Statement B output will be 123

6 0
4 years ago
What are barcode and rfid tags ​
Solnce55 [7]

Answer:

They are both ways to identify assets (e.g., persons, animals, objects).

Explanation:

A barcode is a bit of information (usually a number) printed as a line or block pattern on a surface (e.g., a sticker).

An RFID is a bit of computer memory with an antenna.

Both can be read with the appropriate scanner device.

7 0
3 years ago
Read 2 more answers
What have been three technological changes to photography in the past 200 years?
kolbaska11 [484]
I hope this helps but cars, phones and computers.
3 0
3 years ago
Counselors do NOT provide which service during treatment?
Ivan

Answer:

Civil settlement

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • How do you delete text from a slide
    14·2 answers
  • Maya enjoys connectedWith her friends and social media apps but one of her friends post a lot of stuff that my thinks it’s annoy
    14·1 answer
  • Using a network without the network owner's permission is known as ________.
    10·1 answer
  • I have an LG phone. Since I just bought my phone, my bill to text message isn't paid yet. I texted a couple of things playfully
    5·2 answers
  • What is a seismogram?
    9·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • Which type of financial institution typically has membership requirements?
    9·2 answers
  • Which routing protocol does an exterior router use to collect data to build its routing tables?
    8·1 answer
  • Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the ar
    12·1 answer
  • Mention any
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!