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

  Function named quadratic that receives three parameters

Write the definition of a function named quadratic that receives three double parameters a , b , c . If the value of a is 0 then the function prints the message "no solution for a=0" and returns.

  Prepare a presentation on backgrounds and fonts

Can you still read the text? Is it too narrow or thick? Is an icon hidden by the background? You should also include tips for choosing backgrounds and fonts.

  Ethics and social responsibility

Ethics and social responsibility at McDonalds

  Recursive method to read in string of characters

Trying to write a recursive method that reads in a string of characters and checks to see if the first character is either a 'D' or and 'E', then is followed by a string of one or more 'F's.

  Method takes string and integer as parameters

Write a method called multiConcat which takes a String and an integer as parameters. Return String made up of the string parameter concatenated with itself count times.

  Create logic for program to enter each household size

Create logic for a program that allows a user to enter each household size and find out the mean and median household size in Marengo.

  Prolog program to reads employee-s number

Write a prolog program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Explaining risk in fixed-price contracts

It is recognized that fixed-price contracts offer obvious advantages to buyer organizations because they transfer almost all of the risk to the contractor.

  Describe purpose of keyword super in programs

Describe purpose of keyword 'super' in programs

  Design and implement set of classes to model employees

Design and implement a set of classes to model the employees of a hospital: doctor, nurse, administrator, etc. Include methods in each class.

  Designing menu for administrator to simulate transmissions

Design a menu which permits administrator to simulate transmissions of information by manually typing in login or logoff data.

  Develop the algorithms needed for designer robot

You have been hired as a system designer to develop the algorithms needed for a designer robot that can paint different patterns on the floor based on the commands it receives.

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