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

  Compare and contrast an nap and a mae

Compare and contrast an NAP and a MAE. Name a few examples of each please?

  Which operation following expression will be performed first

Which operation in the following expression will be performed first? c = a++ / b + 5;

  Number of messages needed and the corresponding delay

What is the difference between recursive queries and iterative queriesof DNS servers, in terms of the DNS performance (discuss this in termsof the number of messages needed and the corresponding delay)?

  Design an algorithm for reversing the words in the sentence

Design an algorithm for counting the number of 1's in a 32-bit number. Implement your algorithm using MIPS assembly code.

  Optimal inventory cost and number of orders.

The demand for an item is 8000 units per annum and the unit cost is Re.1/-. Inventory carrying charges of 20% of average inventory cost and ordering cost is Rs. 12.50 per order. Calculate optimal order quantity, optimal order time, optimal inventory ..

  Design a nine-step counter to count

Design a nine-step counter to count in the following sequence using D flip-flops (TTL 74704) on a breadboard

  How to call the function to update the statistics

A function which takes as in the parameters the three counters and displays them to the screen as shown in he example below.

  Design ip scheme for network based on specific

Design an IP scheme for a network based on specific requirements; Assign IP addresses both manually and dynamically to network devices and hosts; Implement a single-area OSPF network;

  Use of technology to solve specific business problems

The Course Project's focus is on the use of technology to solve specific business problems. Although the list of technologies that you can choose for your Course Project is vast, the following are some current technical topic suggestions appropriate ..

  Different types of services

What are the different types of services provided by JBoss server?

  Beat the hacker-audits and assessments

Provide a least two examples of security knowledge that would assist you in preparing for or preventing a threat. Explain the time-sensitive nature of the knowledge.

  Describing fields and options with user account set-up

Describe the fields and options associated with user account set-up.

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