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
"You are on a service call to fix a customer’s printer when she asks you to install a software package. The software is on a per
pickupchik [31]

Answer:

Ask her to get a genuine software

Explanation:

if i will install, it can cause the following problems:

1. Prated software makes your system Vulnerable to the security attacks because the activities of the software are not monitored by any organization and no one is responsible for anything bad happened to your system.

2. It may stop working anytime because there would not be maintenance patches available for it so that it can work properly.

3. It cannot be updated and may cause problems in core functionalities of it.

4.Serious legal actions can be taken against anyone using them because  economy has drastic decrease due ti use of it.

7 0
2 years ago
An object completes one round of circle of radius 7m in 20 sec. Distance travelled after 10 sec is? ​
Ivanshal [37]

Answer:

distance \: travelled \:  = 2\pi \\  \\ 44cm \:  \:  \:  \:  \\ speed \:  =  \frac{44}{2.2}  \ \\ distance \: travelled \: in \: los = 10 \times 2.2 = 22cm \\  \\ total \: distance = 44 + 22 = 66metres

5 0
2 years ago
Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of
xxTIMURxx [149]

Answer:

theSentence = input('Enter sentence: ')

theSentence = theSentence.split()

sentence_split_list =[]

for word in theSentence:

  sentence_split_list.append(word[1:]+word[0]+'ay')

sentence_split_list = ' '.join(sentence_split_list)

print(sentence_split_list)

Explanation:

Using the input function in python Programming language, the user is prompted to enter a sentence. The sentence is splited and and a new list is created with this statements;

theSentence = theSentence.split()

sentence_split_list =[ ]

In this way every word in the sentence becomes an element in this list and individual operations can be carried out on them

Using the append method and list slicing in the for loop, every word in the sentence is converted to a PIG LATIN

The attached screenshot shows the code and output.

5 0
2 years ago
All changes
Vsevolod [243]

You should get up and move every 30 minutes

Hope  this helps

-scav

7 0
2 years ago
Some of y'all make me lose braincells with your questions
boyakko [2]

Answer:

ok done we will try

BTW have a nice day enjoy your day Stay blessed stay happy stay strong

5 0
2 years ago
Read 2 more answers
Other questions:
  • Mara's presentation included essential information about the company's new safety procedures. She wanted to make
    13·2 answers
  • In the Word 2016 window, where is the Status bar located?
    11·2 answers
  • Write a program that will askthe user to enter the amount of a purchase. The program should thencompute the state and county sal
    5·1 answer
  • What is looping in QBASIC​
    9·1 answer
  • A small, electronic chip that a manufacturer develops for use in another product (such as a digital camera or microwave oven) is
    11·2 answers
  • Is downloading like installing?
    13·1 answer
  • Brain for free 12628397
    14·2 answers
  • Where to store <br> ammunition
    5·1 answer
  • 2.
    9·1 answer
  • Difference between sorting and filtering​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!