Purchase Solution

Random number based on lower and upper range input

Not what you're looking for?

Ask Custom Question

i really have no clue where to start.
write a console program that will generate a random number based on lower and upper range inputs. Create a console program where you will implement variables that are needed for this program and will implement the code within Main and any static methods that are called. The program will take inputs for a range of integer numbers, a low end of the range and a high end of the range. These two integer numbers will be used to generate a random number that will be displayed. The program will consist of Main and three void methods. The first method will request the low number for the range and the high number in the range. It will then pass the two range numbers to a second method. The second method will take the two numbers passed to it and will generate a random number within the range. It will then pass the two range numbers and the random number to the third method. The third method will take the three numbers passed to it and display then to the console in the format indicated in the sample output below. Main will only have one line of code which will call the first method. The first method will call the second method and the second method will call the third. You should format your output to look something like the following:
Enter the low integer range number: 1
Enter the high integer range number: 1000
random number from range 1 and 1000 is 710
Press any key to continue . . .

Purchase this Solution

Solution Summary

Easy to understand, self-explanatory code to generate a random number within a specified range in C#. The program implements three static void methods. The main method calls the first method. The first method calls the second and so on. The program is a good example to learn simple arguments passing in a method call.

Solution Preview

using System.IO;
using System;

class Program
{
static void Main()
{
//call first method
FirstMethod();
}

static void FirstMethod()
{
//get number from user
Console.WriteLine("Enter the low integer range ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.