
In C
Objectives:
• Use of functions and passing by value and reference.
• Use of selection constructs.
• Use of repetition constructs (loops).
• The use of the random number generator and seeding.
• Display formatted output using input/outputstatements.
• Use format control strings to format text output.
Description:
For this project you are tasked with building a user application that will select sets of random numbers. Your application must use functions and pass values and pointers. Your program will pick sets of 6 random numbers with values of 1 to 53. The user should be able to choose how many sets to produce. The challenge will be to ensure that no number in a set of 6 numbers is a repeat. The number can be in another set just not a duplicate in the same set of 6. Your program should prompt the user and ask them how many number sets they wish to have generated. The program should not exit unless the user enters a value indicating they wish to quit.
Minimum Requirements:
*input 0 to exist the application nistead of q or Q as shown in picture.
Your program must make use of the following.
1. Your source code must compile for me.
2. Your program must use a user defined function to prompt the user for input and
return it to the calling function. This function will determine the number of groups
of 6 random numbers to generate. The function should also allow the user the
opportunity to enter in a value to quit. You may use a character or a special number
value to determine the user has selected to quit and your program would indicate
this to the calling function (probably main). Your function will not exit the program
but return a value to the calling function indicating the user wants to quit. Your
main function should print out that your user has chosen to quit and then terminate. Your program should not terminate unless the user requests to quit.
3. Your program must use a user defined function to generate a random number set
and return the values to the caller. Use pointers to values in the calling function to
return multiple values. This function should take as arguments a value for the range
and the offset and the pointers to the 6 integers in the calling function. This makes
the function reusable for other random number needs. The function should return
the random integers to the calling function.
4. The range and offset to be used in your program must use a defined constant (not a
memory constant) and the defined constant must be all caps. The range should be
inclusive values 1 thru53.
5. Your program should print the selected values to the screen in a meaningful format.
For example: “Set #1 of six numbers is: XX XX XX XX XX XX” a newline and then “The
second 6 numbers are: XX XX XX XX XX XX”. The output should use a minimum width
of 2 for each number and there should be a space or comma between each number
in the output.
6. Your program should make use of a loop to produce the sets of numbers requested
by the user calling the user defined functions. The program should repeat unless the
user enters in the option to quit.
7. If there is a repeated value in a set of 6 numbers.
8. Your program should contain a program description as a block comment at the top of
your code as shown in the module 2 example. Your functions should also have
function descriptions as shown in the same example.
9. Your user defined functions must use a function prototype in the global declarations
area and have the function definitions under the main function with comments in
your “other functions as needed” area of your source code.
10. Your variable names and function names must follow the naming conventions. •Functions: Start with capitals and use either camel case or an underscore between the parts of a descriptive name for the function.
• Variables: start with lower case and use camel case or an underscore to separate the descriptive name pieces of the variable.
• All Constants should be all uppercase.
11. Your program must be neat and your code should be tabbed in from the left margin.
All nested blocks of code should be tabbed as well.
12. All functions should have a return statement even if they don’t return a value to the
caller.
13. The seed function srand() should only be called once in main.


Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- A for construct is a loop that processes a list of items. As a consequence, it continues to run as long as there are items to process. Is this statement true or false?arrow_forwardPlease submit a flowchart of your program for your project below. Need a class which will contain: Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of number of students in use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program Add comments and use proper indentation. Nice Features: I would like that system to accept a student with no grades, then later add one or more grades, and when all grades are entered, calculate the final average or grade. I would like the system to display the…arrow_forwardAssignment Submission Instructions:This is an individual assignment – no group submissions are allowed. Submit a script file that contains the SELECT statements by assigned date. The outline of the script file lists as follows:/* ******************************************************************************** * Name: YourNameGoesHere * * Class: CST 235 * * Section: * * Date: * * I have not received or given help on this assignment: YourName * ***********************************************************************************/USE RetailDB;####### Tasks: Write SQL Queries ######### -- Task 1 (Customer Information):-- List your SELECT statement below. Make sure the SQL script file can be run successfully in MySQL and show the outcome of the code on MySQLarrow_forward
- Using a Sentinel Value to Control a while Loop in Java Summary In this lab, you write a while loop that uses a sentinel value to control a loop in a Java program that has been provided. You also write the statements that make up the body of the loop. The source code file already contains the necessary variable declarations and output statements. Each theater patron enters a value from 0 to 4 indicating the number of stars the patron awards to the Guide’s featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. At the end of the program, you should display the average star rating for the movie. Instructions Ensure the file named MovieGuide.java is open. Write the while loop using a sentinel value to control the loop, and write the statements that make up the body of the loop to calculate the average star rating. Execute the program by clicking Run. Input the following: 0, 3, 4, 4, 1, 1, 2, -1 Check that the…arrow_forwardIn cengage mindtap The credit plan at TidBit Computer Store specifies a 10% down payment and an annual interest rate of 12%. Monthly payments are 5% of the listed purchase price, minus the down payment. Write a program that takes the purchase price as input. The program should display a table, with appropriate headers, of a payment schedule for the lifetime of the loan. Each row of the table should contain the following items: The month number (beginning with 1) The current total balance owed The interest owed for that month The amount of principal owed for that month The payment for that month The balance remaining after payment The amount of interest for a month is equal to balance × rate / 12. The amount of principal for a month is equal to the monthly payment minus the interest owed.arrow_forwardA word Decrambling game using srand() for descrambling these words: "Screen, Programming, Command, Definition." The game should be timed for 1 minute or 30 seconds using the <ctime> library. Should allow for user input to be able to guess...arrow_forward
- Ruby Programming: Write a function that takes a number x as a parameter and returns the value of x3 Test the function for values x= 2 and x= 3. Output should be 8 and 27 respectively.arrow_forwardInstructor note: Important Coding Guidelines: Use comments, and whitespaces around operators and assignments. Use line breaks and indent your code. Use naming conventions for variables, functions, methods, and more. This makes it easier to understand the code. Write simple code and do not over complicate the logic. Code exhibits simplicity when it’s well organized, logically minimal, and easily readable. A pedometer treats walking 1 step as walking 2.5 feet. Define a method named feetToSteps that takes a double as a parameter, representing the number of feet walked, and returns an integer that represents the number of steps walked. Then, write a main program that reads the number of feet walked as an input, calls method feetToSteps() with the input as an argument, and outputs the number of steps. Use floating-point arithmetic to perform the conversion. Ex: If the input is: 150.5 the output is: 60 The program must define and call a method:public static int feetToSteps(double…arrow_forwardComputer Science Part C: Interactive Driver Program Write an interactive driver program that creates a Course object (you can decide the name and roster/waitlist sizes). Then, use a loop to interactively allow the user to add students, drop students, or view the course. Display the result (success/failure) of each add/drop.arrow_forward
- X609: Magic Date A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. Examples: magicDate(6, 10, 60) -> true magicDate(50, 12, 600) –> falsearrow_forwardMONTY HALL LAB write this code in python and use # to answers questions - You are only allowed to use the following functions/methods: print(), range(), len(), sum(), max(), min(), and .append(). It is not mandatory to useall of these functions/methods. In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a…arrow_forwardA for construct is an iterative loop that processes a list of items. As a consequence, it continues to process items as long as there are things to process. Is this a true or false statement?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





