Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C-programming: Can someone please modify my code below and help with the following problem. 1. Create a separate function that prompts a user

Write a C-programming:

Can someone please modify my code below and help with the following problem.

1. Create a separate function that prompts a user for the number of times they would like to roll an 8 sided die.

2. Create a separate function that rolls the die using random number generation.

3. Create a separate function that output the results.

DO NOT use any global variables and the main function should only have function calls and variables. Do not call a function from another function. The output should exactly look like the sample output.

Use Arrays for this assignment.

//sample output

How many times would you like to roll the 8 sided die? 50

You had:

10 ones

5 twos

4 threes

6 fours

5 fives

7 sixes

3 sevens

10 eights

image text in transcribed

image text in transcribed

#include #include #include = int prompt(void); int modarray(int a[], int size); void printArray(int a[], int size); int main(void) { int arrint[8]={@}; int x,y,i; srand(time(NULL)); x=prompt(); for(i @; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions