Question: Need code in C++ 1. Write the prototype/interface/header of a function named getInt that returns an int. The function accepts a double parameter by reference

Need code in C++

1. Write the prototype/interface/header of a function named getInt that returns an int. The function accepts a double parameter by reference and a string parameter by value.

2. Write the definition of void function with three reference parameters of type int, double, and string. The function sets the values of the int and double parameters to 100 and the string variable to an empty string.

3. Write a function named isPrime() that determines whether an integer is a prime number. Use the following function header: bool isPrime(int num). An integer greater than 1 is a prime number if its only divisors are 1 and itself. For example, isPrime(11) returns true, and isPrime(9) returns false. In a loop, ask the user to enter an integer and using the function tell them if the number is prime or not. Allow the user to try as many numbers as wished.

4. Write a function to simulate throwing a dice (an integer between 1 and 6). The function displays the value of the dice thrown. The function has a parameter that identifies the number of times to roll a dice. If you call the function as rollDice(5), you should see 5 numbers displayed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!