Write a program that reads a list of integers

Assignment Help Programming Languages
Reference no: EM132248221

Question: Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input consists of five integers.

Ex: If the input is 2 4 6 8 10, the output is:

all even

Ex: If the input is 1 3 5 7 9, the output is:

all odd

Ex: If the input is 1 2 3 4 5, the output is:

not all even or all odd

Your program should define and use two functions:

Function countEvensInArray(integer array(?) userVals) returns integer numEven

Function countOddsInArray(integer array(?) userVals) returns integer numOdd

countEvensInArray should return 5 if all integers in the array are even. countOddsInArray should return 5 if all integers in the array are odd.

Reference no: EM132248221

Questions Cloud

Recommendations for improvement det diversity policy : Anyone can hep to make recommendations for improvement DET Diversity Policy
Discuss new skills you acquired from the class : Base on the course content, discuss new skills you acquired from this class? How relevant are the new skills to your current and/or future profession?
Describe how the data is displayed : Kirk (2016) tells us that data adjustments affects what data is displayed and presentation adjustments affects how the data is displayed.
Benefits of using earned value management in projects : Explain five benefits of using Earned Value Management in Projects. Outline the marketing opportunities in BRIC countries.
Write a program that reads a list of integers : Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.
Flow-time efficiency of patient for major treatment : What percentage is the flow-time efficiency of a patient for major treatment? what is the average waiting time (in minutes) to be seen by a dentist?
What is the history of the case : Possible questions to answer would be: Who is the plaintiff? The defendant? The appellant? The appellee?
Identify a case study with an appropriate situation : Research the web and identify a case study with an appropriate situation related to penetration testing or hacking for or against a business, organization.
Honest and transparent with dealings : Toms is a brand that has established itself as humanitarian. Whether the brand takes anything away from other shoe manufacturers

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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