Calculate the average of a variable quantity of integers

Assignment Help Programming Languages
Reference no: EM13693809

Question: Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called. This uses the argv array from main - you should not use "scanf" or "cin" functions to complete this project.

When the program is launched, have it display a welcome message.

Also make sure to have the program display a help message if the user forgets to give any integers as the argument.

The below examples show the program on a Windows system.

If you use a Mac or Linux your program very likely will not have the ".exe" extension which is fine.

Example of calling the program with arguments:

average.exe 1 2 3 4 5 6

The result of the above should be something similar to:

Welcome to the Average Program. It is very average really.

The average is: 3.5

Example of calling the program without arguments:

            average.exe

The result might be:

            Welcome to the Average Program. It is very average really.

     Usage: average X (X is 1 or more integers)

I'm not sure how to solve the program. Can anyone help me? Provide the code.

Reference no: EM13693809

Questions Cloud

Economists occasionally speak of helicopter money : Economists occasionally speak of “helicopter money” as a short-hand approach to explaining increases in the money supply. Suppose the Governor of the Fed flies over the country in a helicopter dropping 10,000,000 in newly printed $100 bills (a total ..
Generate a salary as a number with two digits : Generate a salary as a number with two digits after the decimal point. The salary for a teacher should be in the range from $40,000 to 70,000.
Program to tests whether they form a magic square : Write a program that reads n2 numbers from standard input and tests whether they form a magic square when put into matrix form.
Write a program to print out a simplified bill : Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.
Calculate the average of a variable quantity of integers : Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called.
Write a program to print all of the permutations : Write a program to print all of the permutations of the values 1, 2, 3, ..., n - Your program takes one argument from the command line, which as an integer n  that is the number of elements.
What rules of inference are used in the argument : What rules of inference are used in the argument? "No man is an island. Manhattan is an island. Therefore, Manhattan is not a man."
Rules of inference to show that the hypotheses : Use rules of inference to show that the hypotheses "if it does not rain or if it is not foggy, then the sailing race will be held and the life saving demonstration will go on,"
Find the negation of each of statements : Use de Morgans law to find the negation of each of the subsequent statements - kwame will take a job in industry or go to graduate school.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write program to will read unspecified number of positive

Write a program which will read the unspecified number of positive numbers from keyboard and determine the sum and average of these numbers.

  Creating class savingsaccount using static variable

Create class SavingsAccount. Use static variable annualInterestRate to store annual interest rate for all account holders.

  Estimate probability of default for a credit application

What would you suggest as the target variable and what would you recommend that Joe do to achieve his business goal?

  Write program to prints formatted table of windchill values

Write a program which prints nicely formatted table of windchill values. Rows must represent wind speed for 0 to 50 in 5 mph increments.

  Create program by using pseudocode along with structure

Create a program by using pseudocode along with structure to do the following. Permit the user to enter series of temperatures in degrees Celsius (C) terminated by -999.

  Two-dimensional array to store weekly hours for employees

Assume the weekly hours for all employees are stored in two-dimensional array. Each row records emaployee's seven-day workhours with seven columns.

  Customer ordering mobile app of a pizza house

Application should be adaptive enough to render on multiple devices with various form factors. To make customer experience best advanced capabilities like geo-location, augmented reality and mashups should be used.

  Draw a flowchart to accept five daily temperature readings

Draw a flowchart to accept five daily temperature readings and displays the highest, lowest, and average (mean) temperatures. Use a For loop to take the five readings.

  Create an xml document that marks up nutrition facts

Create an XML document that marks up the nutrition facts for a package of Grandma White's cookies. A package of cookies has a serving size of 1 package.

  Design the software architecture of a web auctioning site

Design the software architecture of a Web auctioning site and design a database for storing information about users, items, auctions and bids.

  Explaining tags used for effective page layout

Page layout is one of the most time consuming tasks for a web designer. What are some of the tags used for effective page layout and how do they work?

  Create a print stream object using dos

Create a PrintStream object using dos and assign the resulting reference to ps, a PrintStream variable that has already been declared.

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