Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C language), needs to produce the same output (1st, 2nd, 3rd...etc) Coding 3: Create averages.c Create a new program that will ask a user to

(C language), needs to produce the same output (1st, 2nd, 3rd...etc)image text in transcribedimage text in transcribed

Coding 3: Create averages.c Create a new program that will ask a user to enter a number repeatedly. This program will calculate 2 averages based on whether the sum of digits in the inputted numbers are odd or even: avg_even (average of all inputs whose digits sum up to an even number) and avg_odd (average of all inputs whose digits sum up to an odd number). The program will stop when the user enters a O. For example, the numbers 2, 26 and 123 are those whose digits sum up to an even number (2, 2+6=8 and 1+2+3=6, respectively). Your program must produce an output that exactly resembles the Sample Runs, including identical wording of prompts, spacing, input locations, etc. Notice that the text in the input prompts, where the user enters an integer, changes each time -- stating "1st integer", "2nd integer", "3rd integer", "4th integer", etc. You will need to code this behavior into your program. Sample Runs (user input shown in blue, with each run separated by a dashed line): SAMPLE RUN 1 Please enter the 1st integer: 2 Please enter the 2nd integer: 26 Please enter the 3rd integer: 123 Please enter the 4th integer: 3 Please enter the 5th integer: -14 Please enter the 6th integer: 111 Please enter the 7th integer: 0 Average of inputs whose digits sum up to an even number: 50.33 Average of inputs whose digits sum up to an odd number: 33.33 . - SAMPLE RUN 2 Please enter the 1st integer: 92 Please enter the 2nd integer: -142 Please enter the 3rd integer: 7 Please enter the 4th integer: 36 Please enter the 5th integer: 0 Average of inputs whose digits sum up to an odd number: -1.75 SAMPLE RUN 3 Please enter an integer: 0 There is no average to compute

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions

Question

What changes (if any) would you make going forward?

Answered: 1 week ago

Question

Are there fewer of them to do it (i.e., have you been downsizing)?

Answered: 1 week ago

Question

Current liabilities differ from long - term liabilities based on:

Answered: 1 week ago