Program that calculates the average of n integers

Assignment Help Basic Computer Science
Reference no: EM131280229

Write a program that calculates the average of N integers. The program should prompt the user to enter the value for N and then afterward must enter all N numbers. Use an array to save the N integers. If the user enters a nonpositive value for N, then an exception should be thrown (and caught) with the message "N must be positive." If there is any exception as the user is entering the N numbers, an error message should be displayed, and the user prompted to enter the number again.

Reference no: EM131280229

Questions Cloud

Program using pseudocode to solve the following problem : Develop a menu-driven program that inputs two numbers and, at the user's option, finds their sum, difference, product, or quotient.
Create a life long learning personal and professional plan : Create a Life-Long Learning Personal and Professional Plan that advances career success.- Map future career goals by detailing the given.
Show that the dual of exclusive-or is also its complement : Derive the circuits for a three-bit parity generator and four-bit parity checker using an odd parity bit.
Proposal of a local area network for a company : Suppose you have been asked to give a proposal of a Local Area Network for a company which requires easy reconfiguring, efficient in speed and economical in cost network.
Program that calculates the average of n integers : Write a program that calculates the average of N integers. The program should prompt the user to enter the value for N and then afterward must enter all N numbers. Use an array to save the N integers.
Vendor relationships and marketing it value : Many organizations use information technology vendors to develop company solutions. Determine at least three (3) challenges associated with using vendors. Analyze the relationship between competitive advantage and vendor relationship management ov..
Write a verilog gate-level description of the circuit : The exclusive-OR circuit of Fig. 3.32(a) has gates with a delay of 4 ns for an inverter, a 8 ns delay for an AND gate. and a 10 ns delay for an OR gate. The input of the circuit goes from xy= 00 to xy = 01.
Write a verilog user-defined primitive : A majority logic function is a Boolean function that is equal to 1 if the majority of the variables are equal to I. equal to 0 otherwise. Write a Verilog user-defined primitive for a four-bit majori-ty function.
Write a java program which reads a text file : 1. Write a Java program which reads a text file called mydata.txt containing the following numbers: 34 56 76 98 12 33 58 42 98 93 and computes the minimum, maximum sum and average of the numbers and puts the output in a file called myresults.txt.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Different phases of the knowledge discovery from databases

Describe a complete application scenario in which new knowledge may be mined from an existing database of transactions.

  What are all tangible benefits of information systems

A company that controls finances in the home country and decentralizes production, sales, and marketing operations to other countries is using a __________ strategy.

  Which search engine do you believe provided

Which search engine do you believe provided you the best results? Support your position by explaining why you believe the particular search engine to be better based upon your experience.

  Distinguish web pages or web servers use for task

Suppose the role of the IT consultant to new nonprofit organization, Free Flu, to provides flu shots to the elderly. The organization requires the domain name. Distinguish between any Web pages or Web servers you would use for task.

  What patterns would hash to the same location

The hash table is 10,000 entries long (HASH_TABLE_SIZE is 10000). The search keys are integers in the range 0 through 9999. The hash function is given by the following C++ function:

  Determine the thrust produced by this turbojet engine

Determine the total exergy destruction associated with the Otto cycle described in Problem 9-33, assuming a source temperature of 2000 K and a sink temperature of 300 K. Also, determine the energy at the end of the power stroke.

  What is the size of a char and a string

What are the sizes in memory of other data types in C++? I mean, I know that a double is 8 bytes and an int is 4 bytes. What is the size of a Char and a String?

  Displaying all n integers in a sorted linked chain

Displaying all n integers in a sorted linked chain

  Evm concepts of cost and schedule variance

Describe in your own words, the EVM concepts of cost and schedule variance. Apply what you know about these metrics by providing a specific example of each concept from a real or hypothetical project that you have previously handled or heard about..

  How frequently should your personal computer be scanned

Name and briefly describe three different types of malware that could infect a personal computer running the Windows operating system.

  Determine the types of organizations

Analyze the major ways that cryptography can help alleviate risks that exist when using cloud computing. Determine the types of organizations that would benefit the most from enabling cryptography while using cloud computing. Provide a rationale f..

  Select appropriate variable

1. (TCOs 1-8) NOTE: YOU DO NOT have to compile/run this code in eclipse. You are writing the code here only. Write a class called point that has attributes and methods to model an (x,y) coordinate in a 2-D environment. Select appropriate variable(s..

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