Write a program that stores numbers in the given range

Assignment Help Programming Languages
Reference no: EM132211455

Question: Write a program that stores numbers from the range 0 - 1000 in an array.

Your program should

Create an array of size 50

Run in two modes and ask the user which mode they want to run in

(T)est Mode: store the numbers 1 though 50 into the array,

(P)roduction Mode - Fill the array with a file called numbers.txt

Ask the user for a number, validate that it is in the range of the array numbers, then

Call the following function

The function accepts 3 arguments - the array, the size of the array and the user number. It should then print the location (index) and the value of all numbers larger than the user's number.

In test mode the numbers in the array are limited to being filled with 1 through 50, and the user input is limited to 1 through 50

In production mode the program will fill the array from a file filled with unknown numbers from the file numbers.txt, and limit the user test number to the range 0-1000

Note: You will need other functions in my program I ended up with 2 other functions. Make sure your function matches the description above, the others can be as you design them

Make sure you check for input ranges on inputs.

You will find attached an executable to run showing the program output, and a numbers.txt to use with your program.

number.txt file 721 37 620 577 85 536 598 291 125 631 76 639 677 423 321 877 266 796 670 613 436 223 83 316 647 786 844 163 835 64 921 425 419 648 67 48 956 595 236 254 447 211 943 877 256 951 680 196 111 484

Reference no: EM132211455

Questions Cloud

Write a program that requests a floating point number : Write a program that requests a floating point number then separately outputs the integer and fractional components.
Write a program that simulates the rolling of two dice : Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and again use it to roll the second die.
Write a program that repeatedly asks the user to type : Write a program that repeatedly asks the user to type in a sentence and press Enter. Your program will store each sentence the user types into some container.
Write a program that searches for a particular item : Write a program that searches for a particular item in a huge random array and see how long it take, using linear and binary searches.
Write a program that stores numbers in the given range : Write a program that stores numbers from the range 0 - 1000 in an array. Your program should. Create an array of size 50. Run in two modes and ask the user.
Write a program that solves the coin row problem : Write a program that solves the Coin Row problem in the C++ language. Your program should ask a user for the number of coins and coin values.
Write a program that reads ten numbers from the screen : Write a program that reads 10 numbers from the screen, calculates the mean (average), finds the minimum and maximum values, and outputs them to the screen.
Create a list of these numbers and find the arithmetic mean : Write a program for: In a text file INPUT integers separated by a space, perhaps in a few lines.
Write a program that reads a file of dna data : Write a program that reads a file of DNA data and searches for protein sequences. DNA data consists of long strings of the letters A,C,G, and T.

Reviews

Write a Review

Programming Languages Questions & Answers

  Compute the product xy

Given two integers X and Y compute the product XY (multiplication), the quotient X=Y (integer division), and the modulus X (mod Y) (remainder).

  Modify the startup code so that the program calls a function

Modify the startup code so that the program calls a function that reads the player's data from the text file into the list of member objects.

  What can you do to overcome the challenges

PRG 420- In your opinion, what are the three biggest challenges in planning and designing a solution for a programming problem? What can you do to overcome these challenges? How would you apply these techniques to the programs in this class?

  Calculate the power of any number a raised to the exponent n

Power.java which contain the details of creating the Power class and the method power which should calculate the power of any number a raised to the exponent n.

  Create a new method named spin for the seeingstars object

Create a new method named spin for the seeingStars object. A "spin" is 2 revolutions, turning either left or right. In the spinmethod,the stars should spin left about half the time and spin right the other half.

  Unix or linux versus microsoft windows server

Programmability - address the benefits and disadvantages of using UNIX or Linux versus Microsoft Windows Server within the organization, then propose one of the products.

  Advantages cloud computing

advantages Cloud computing

  Manage listing of missionaries on staff at the organization

In this assignment, you are to design an application, which will manage a listing of missionaries on staff at the Organization Go and Tell.

  Html5 assignment i need an assignment for html5 containing

i need an assignment for html5 containing 2 parts1 3 pages html5 website2 report more important than the website

  Write a program that will operate the alarm simulation

Write a program that will operate the Alarm Simulation, using the following inputs and outputs and whatever Timers and Flags are required.

  Eclipse ide to produce working java code files

300581 Programming Techniques - Eclipse IDE to produce working Java code files - This question will contribute 30% of the marks for Prac Set 1.

  Median-of-medians algorithm partitions input into groups

Median-of-medians algorithm to solve selection problem. Complete following exercises. Median-of-medians algorithm partitions input into groups of 5 elements, but it also works if we partition input into groups of 7.

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