Write a function that takes integer n as a parameter

Assignment Help C/C++ Programming
Reference no: EM131912898

Random Palindrome: Write a function that takes integer N as a parameter. This function then generates N random digits (numbers between 0 and 9) using the computer time as the seed of the random number generator.

The probability that a generated digit is even is 80% whereas the probability that a generated digit is odd is 20%.

The function then concatenates the N randomly created digits to form one number. This function then checks if this number is a palindrome or not. (Hint: find the reverse of that number) Finally, the function prints out the number and says whether it is a palindrome or not.
Example]:

Please enter the length of a number: 6
The concatenation of the 6 randomly generated numbers is: 258852 The number is a palindrome!
Example2:
Please enter the length of a number: 5
The concatenation of the 5 randomly generated numbers is: 86824 The number is a NOT a palindrome!

Reference no: EM131912898

Questions Cloud

What is a priority queue : What is a Queue and provide an example of a Queue, name the Queue basic operations and what they are responsible for in your example
Calculate the labor and material variances : Materials and Labor Variances. The Cakebread Candy Company presents the following data for October. Calculate the labor and material variances.
Describe an example that uses discrete probabilities : Provide an example that follows either a binomial or Poisson distribution, and explain why that example follows that particular distribution.
How much would division cs income from operations increase : How much would Division C's income from operations increase (decrease)? How much would Division A's income from operations increase (decrease)?
Write a function that takes integer n as a parameter : Write a function that takes integer N as a parameter. This function then generates N random digits (numbers between 0 and 9) using the computer time as the seed
Results of sampling independent populations : Note that the population variance are known. Test H0: Population 1 mean -Population 2 mean = 0 at a = 0.05. HA:
Calculate the amount by which the primo portfolio out : Calculate the amount by which the Primo portfolio out- (or under-) performed the market over the period? (Round your answer to 1 decimal place.
Create charts that display your overall grade : In this project, you will create and format charts that display your overall grade average for the courses that you are currently taking.
Standard error of the difference in sample proportions : Find the standard error of the difference in sample proportions.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a driver program called testrationalnumber.cpp

Write a driver program called testRationalNumber.cpp to test each of the above functions and overloaded operators in the RationalNumber class.

  Figure out what is the largest power of 2 that is less than

Ask the user for a number between 3 and 100 (inclusive). USING LOOPS, figure out what is the largest power of 2 that is less than or equal to the number entered. For example, if the user entered 6, answer would be 4. If the user entered 100, the answ..

  Write a c program to find the 2s complement

Write a C program to find the 2's complement of a binary number.

  Write a function called reversit that reverses a string

Write a function called reversit() that reverses a string (an array of char ). Use a for loop that swaps the first and last characters, then the second and next to lastcharacters and so on. The string should be passed to reversit() as an argument. wr..

  Prepare a set of uml class relationship diagrams

Give an initial list of candidate classes and responsibilities and give an initial set of CRC cards -  Prepare a set of 3 UML class relationship diagrams highlighting important relations among the discovered classes.

  Mark the following statements as true or false

Mark the following statements as true or false.

  Problems related to math power

Write a public static function named power that takes in two integers, a and b, and returns a^b, the first argument to the power of the second argument. You may NOT use Math.pow(), because that would be boring.

  Program that implements the described behavior

The railway network is defined by pairs of stations and distance between each pair - Program reads configurations files, check for configuration errors

  Evaluate the restriction of assembly

1. Evaluate the restriction of Assembly. Make all computations and note the value of X and Y. 2. Evaluate Restriction Test. Make all computations and note the value of X and Y.

  C++ code to find the greatest common divisor

C++ Code to find the Greatest common divisor between two numbers.

  Write down a program which will calculate and displays min

write down a program which will calculate and displays the min temperature and the maximum temperature for seven days of a week.

  Write a program that will read input and write it back out

Write a program that will read input, and write it back out, character by character. Propend each line of input with a line number.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd