Language: C Programming, Please leave as many comments as possible!
Create a program that has a menu as shown:
1. Generate 500 Random Numbers between 1 and 500
2. Show Current Set of Random Numbers ordered from Low To High
3. Show Frequency of each number from 1 to 500
4. Quit
The program will store all random number in an array on the heap.
#include<stdio.h>
#include<stdlib.h>
void sort(int values[], int numValues){
int i, j;
int temp;
// outer loop to travel through the
all elements
for (i = 0; i < numValues - 1;
i++) {
// inner loop to
compare the outer loop elements
for (j = 0; j
< numValues - i - 1; j++)
// if element at j< than j+1 than swap
both
if (values[j] > values[j + 1]) {
// swap logic
temp = values[j];
values[j] =
values[j+1];
values[j+1] = temp;
}
}
}
int main(){
//array to store elements
int * arr=(int *)calloc(sizeof(int),500),n;
//array to store frequency of each element
int * counter=(int *)calloc(sizeof(int),500);
//iterating throgh 1-500 to generate random numbers
for(int i=0;i<500;i++){
n=rand()%500;
arr[i]=n;
counter[n]++;
}
//sorting the generated values
sort(arr,500);
//printing the values
for(int i=0;i<500;i++)
printf("%d ",arr[i]);
//pritning the frequency
printf("\nFrequency:\n");
printf("Number\tFrequency\n");
for(int i=0;i<500;i++)
if(counter[i]!=0)
printf("%d\t%d\n",arr[i],counter[i]);
}

Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
Language: C Programming, Please leave as many comments as possible! Create a program that has a...
***************C PROGRAMMING ONLY************* Demonstrate the ability to create an array on the stack Demonstrate the ability to create an array on the heap allowing user to choose the number of values to store. Demonstrate the ability to store an array of Struct values on both the stack and the heap. Program Specifications: 1. Create a struct with at least 3 fields - any struct you want but explain it in your comments in the code. Populate at least 10 elements...
Any programming language may be used. Please indicate what language you have chosen. You are an analytics developer, and you need to write the searching algorithm to find the element. Your program should perform the following: Implement the Binary Search function. Write a random number generator that creates 1,000 elements, and store them in the array. Write a random number generator that generates a single element called searched value. Pass the searched value and array into the Binary Search function....
Answer should be in C programming language
Write a program that will create an array of 10 floating point numbers and take input 10 floats from keyboard. The program will print the position (index) of the maximum and minimum number among them
C++ programming please Write a program that will display random numbers in order from low to high. 1. Declare an integer array of size 100. Ask the user how many numbers to work with (n). It can be less than 100. 2. Generate random numbers from 10 to 50. 3. Write the random numbers to an output file named random.dat. Close the file. 4. Open random.dat for input and read the data values into your array. Pass your array to...
Please post following code with criteria below... please leave as many comments as possible Exam Four: the election Outcome: Student will demonstrate all core competencies from this class: Program Design (design tools) Variables Decision Error Checking Looping Functions Arrays Program Specifications: Let’s pretend that we are tracking votes for the next presidential election. There will be two candidates: Ivanka Trump and Michele Obama. You can assume that there are fifty states casting votes. You will do not need to deal...
Language is C programming Student ID should be 8 numbers long. create a program to read your student ID number and store it in an array. Input can not be hard wired, I have to be able to input my number Then change the first number to a letter. If the same number repeats in other parts of your student ID, you must change that number to a letter as well. print original array and modified array as your output....
Microsoft Excel VBA (Visual Basic for Applications) Programming
Language
Objectives: Create an array and redim it to a size equal to an
assigned value of a variable, populate the array with a series of
random numbers, output the array to a message box and to a
worksheet.
Instructions:
- Review the variables already declared. You won't need
others.
- See comments in the code that will act as your guide. Add new
code directly after each comment.
- Assign a...
THE PROGRAMMING LANGUAGE IS C++ Part 1.Create a program that decides whether a given integer is prime or not. The program should at the end of its analysis print the number followed by prime or composite. Part 2.Make the program from part 1 print the prime factors of any composite number entered (an additional feature to Part 1). THE PROGRAMMING LANGUAGE IS C++
In C language The project should create a code maker. The computer version of this game uses digits 0-9 for the code. The feedback may be an array of characters using ‘b’ for black and ‘w’ for white. 1. The program should generate a code i. First, generate random number from 0 to 9. Actually, generate 4 random numbers ii. If any random number is repeated, replace the repeated number iii. Loop step ii until there is no repetition 2....
Programming C++ Language, PLEASE HELP, Will upvote Write a program that first generates two random decimal numbers within the range -100 to 100 inclusive. Next, generate a random number between 1 and 4 inclusive to correspond to each of our math operators (+, -, *, /). Finally, write out to a file called mathWorksheet.txt the following format: A o B = ? With A and B replaced by the two random numbers that were generated and o replaced by the...