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
Write a program that converts temperatures in the Celsius scale to temperatures in the Fahrenheit scale. Your program should ask
Aleks [24]

Answer:

#include <iostream>

using namespace std;

int main()

{

   float celsius;

  cout<<"Enter the temperature in Celsius: ";

  cin>>celsius;

 

  float Fahrenheit  = 1.8 * celsius + 32;

  cout<<"The temperature in Fahrenheit  is: "<<Fahrenheit<<endl;

}

Explanation:

first include the library iostream in the c++ programming.

Then, create the main function and declare the variable celsius.

cout is used to print the message on the screen.

cin is used to store the user enter value in the variable.

then, apply the formula for calculating the temperature in Fahrenheit

and store the result in the variable.

Finally, print the result.

6 0
3 years ago
A(n) ________ is a light-sensitive material used to make a chip.
RSB [31]
The photoresist is a light-sensitive material used to make a chip. Photoresists can likewise be uncovered by electron shafts, creating an indistinguishable outcomes from introduction by light. The primary distinction is that while photons are consumed, storing all their vitality without a moment's delay, electrons store their vitality bit by bit, and scramble inside the photoresist amid this procedure.
3 0
4 years ago
Write a program that asks the user for three strings. Then, print out whether the first string concatenated to the second string
ipn [44]

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter The First String");

       String str1 = in.next();

       System.out.println("Enter The Second String");

       String str2 = in.next();

       System.out.println("Enter The Third String");

       String str3 = in.next();

       String oneAndTwo = str1+str2;

       if(str3.equals(oneAndTwo)){

           System.out.println(str1+" + "+str2+" is equal to "+str3+"!");

       }

       else

           System.out.println(str1+" + "+str2+" is not equal to "+str3+"!");

   }

}

Explanation:

  • Implemented in Using Java Programming Language
  • Import Scanner Class to prompt and receive users' input
  • Create three string variables and store the three values entered by the user (str1, str2 and str3)
  • Concatenate str1 and str2 using the + operator and assign to a new variable
  • Use the if statement with Java's .equals() method to check for equality of the new string with the third string
  • Print the appropriate message if the equal or not
8 0
3 years ago
The illustrations group contains all but a _______​
antiseptic1488 [7]

Answer:

Shapes button

Chart button

Photo button

Pictures button

Explanation:

In Microsoft Word, the illustration group has all the following options apart from the photo button. It can be found in the Insert tab of the Word document. The illustrations group is where you make several adjustments to your Word document by inserting online and offline pictures and clip art, shapes, charts, and screen shots.

6 0
3 years ago
10
Dmitrij [34]

Answer:

i need more \\

Explanation:

Chemical cold packs should be used for bone and joint injuries because they are generally colder than ice and stay cold longer.

A.  

True

B.  

False

Reset

4 0
3 years ago
Other questions:
  • Your crt monitor flickers. what should you do
    6·1 answer
  • A(n) ____ is a system designed to handle only very basic applications with an absolute minimum amount of hardware required by th
    9·1 answer
  • _____ are unique identifiers of computer or network addresses on the internet.
    6·2 answers
  • How USB FLASH Drives Store Data? Explain, Maximum 5 linesa
    10·1 answer
  • Why do you think that backlighting is used in so much of Sheldon’s photography?
    7·2 answers
  • What is the complete predicate in the sentence below? Looking up from his computer monitor, Jason mopped his brow, exhaled sharp
    12·1 answer
  • Susan's monthly goal to open five new customer
    10·1 answer
  • A __________ is a sequence of characters.
    10·1 answer
  • How are the functions different and how do i determine the answer
    5·1 answer
  • Outline the steps for logging into E-mail account​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!