CSCI 261 - Programming Concepts - Spring 2022

Lab 1C - Random Generation & Classification

This lab is due by Tuesday, February 01, 2022, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.


Generate & Classify a Random Value



In class we went through the process of generating a random number. Modify/extend the class example to accomplish the following steps:

  1. Prompt the user to enter the minimum value
  2. Prompt the user to enter the maximum value
  3. Print a random float in the range of min-max
  4. Print which quartile this value is in

An example interaction is shown below:

Enter the minimum value: 1
Enter the maximum value: 10
A random value is: 2.1
This is in the first quartile
Enter the minimum value: 4.5
Enter the maximum value: 13.75
A random value is: 12.2
This is in the fourth quartile

Lab Submission


Submit your main.cpp file(s).

You will submit your solution to this lab with the rest of Set1. Detailed instructions for doing this are posted in Assignment 1.


This lab is due by Tuesday, February 01, 2022, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.