Write a program to enter series of numbers

Assignment Help Programming Languages
Reference no: EM1353567

Q1) Write a program that ask the user to enter a series of numbers ending with -1. After the -1 is input, program should print how many numbers are even and how many numbers are odd. The test for even is that number % 2 == 0.

For this program, you'll need two accumulator variables - one to count the number of even numbers and one to count the number of odd numbers.

Where should the test for even-ness be?

Reference no: EM1353567

Questions Cloud

Elucidate how much profit do the low-cost firms make : If none of the high-cost firms makes a positive profit, how large is n. Elucidate how much profit do the low-cost firms make.
Calculation of standard deviation : During a normal economy, the common stock of Douglass & Frank is expected to return 12.5%. During a recession, the expected return is -5% and during a boom, the expected return is 18%.
Outline sigmund freuds basic concepts : Briefly outline Sigmund Freuds basic concepts with one or two sentences each; Endopsychic conflicts; Defense mechanism; The conscious continuum; and The psychosexual stages of development.
Illustrate what is the likely bargaining negotiation outcome : Illustrate what is the likely bargaining negotiation outcome if the advertisers bargain by telling each newspaper that they're going to reach agreement with the other newspaper.
Write a program to enter series of numbers : Write a program that ask the user to enter a series of numbers ending with -1. After the -1 is input, program should print how many numbers are even and how many numbers are odd.
Explain aggregate expenditure to model : Use the aggregate expenditure model to explain the following statements from the opening news article.
Multiculturally competent practitioner : What are the characteristics, beliefs, attitudes, and knowledge of a multiculturally competent practitioner?
Compute expected rate of return : Tammy has a portfolio comprised of 10% stock A, 60% stock B, and 30 percent stock C. Compute her expected rate of return?
Approach for building site in-house with existing staff : Web site Consider your options for building the site in-house with existing staff, or outsourcing the entire operation. Decide which strategy you believe is in your company's best interest and create a brief presentation outlining your position.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to enter answer to a math problem

Write a program which ask student to enter an answer to a math problem. The user must enter two values, one at time, and then ask for answer.

  Different class maintain programming programs are organized

It allows different classes to maintain programming so that programs are kept more organized. Object orientation also allows a programmer to use the same objects in different programs. Response?

  Write pseudocode and flowchart for program

Write pseudocode and flowchart for program that will prompt the user for a number, prompt the user for an operator (+,-,*,/).

  Computing first seven values of fibonacci number sequence

Write a program that uses a loop to compute the first seven values of the Fibonacci number sequence.

  Create a simple shell

Create a simple shell. Basically your shell should read the line from standard input, parse the line with command and arguments, and operate the command with arguments.

  Give hypertext link of the internet location of program

Describe in one or two paragraphs what you observe. Give hypertext link of the internet location of the program (or applet) you found.

  Program to find real solutions

Method, which determines whether value of "b squared" - 4ac is negative. If negative, code then  prints out message "no real solutions" and returns from method.

  Questions on programing problem with the process of analysis

Questions on Programing Problem with the process of analysis and reflection that went on as you developed the project.

  Explaining steps to execute branch instruction

Sketch a flow chart which carefully explains steps that little man follows to execute a branch instruction.

  Class to create and draw five squares

Now write applet DrawSquares that uses your Square class to design and draw 5 squares. This code must be very simple.

  Program to use next character to create and return operator

Convert the string of digits into an integer. Otherwise, use the next character to create and return an operator.

  Formula translation

Write a c code that will evaluate the roots of a quadratic equation

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd