Write a cpp program for magic number

Assignment Help C/C++ Programming
Reference no: EM13763088

Instructions

Ask the user to enter a "magic number," which is an integer between 0 and 9, inclusive.

Then, ask a user to enter 10 integers between 0 and 9, inclusive. (If a user enters an integer outside of that range, therefore invalid, notify the user of the error and ask for him/her to try again. Invalid numbers do not count towards the 10 valid integers requirement.)

NOTE: User input should be done in a repetition structure (loop). Ten sequential input statements will not satisfy the requirements of this assignment.

Your program should output the following:

How many times the user entered the magic number.

The average of all the valid numbers that the user entered.

Sample Output:

What is the "magic number?" 4

Enter a number from 0 to 9: 4

Enter a number from 0 to 9: 1

Enter a number from 0 to 9: 4

Enter a number from 0 to 9: 3

Enter a number from 0 to 9: 7

Enter a number from 0 to 9: 1

Enter a number from 0 to 9: 5

Enter a number from 0 to

Reference no: EM13763088

Questions Cloud

Algorithm attributes and their importance. : Write a 2 page research paper (excluding title and reference pages) on algorithm attributes and their importance. Use two resources (Wikipedia sources are not permitted) and list each resource used at the end of the paper in the reference list sec..
Function that returns a token when it is needed. : A major component of your assignment will be to write a procedure (Function) that returns a token when it is needed. Your lexer should return a record, one field for the token and another field the actual "value" of the token (lexeme), i.e. the in..
What were you most surprised to learn from the film : What were you most surprised to learn from the film? Why did the American government decide to assimilate Native American children into Western culture?
Ratio computations and effect of transactions : Presented below is information related to Carver Inc.
Write a cpp program for magic number : Ask the user to enter a "magic number," which is an integer between 0 and 9, inclusive. Then, ask a user to enter 10 integers between 0 and 9, inclusive. If a user enters an integer outside of that range, therefore invalid, notify the user of the ..
Write down the first order necessary conditions : Write down the Lagrangean for problem and Write down the first order necessary conditions (FOC) for a minimum.
What you have learned about children who are gifted : What you have learned about children who are gifted and talented. What are the special needs of young children who are gifted and talented? What are the special needs of older children?
Problems related to astronomy : What is the approximate wavelength of this signal?
Modify the inventory program to include an add button : Modify the Inventory Program to include an add button, a delete button, and a modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock, and the price of each ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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