Write a program that uses a random number generator

Assignment Help Programming Languages
Reference no: EM13763024

Write a program that uses a random number generator to generate a two digit positive integer and allows user to perform one or more of the following operations-

a. double the number

b. reverse the digit of the number

c. raise the number to the power of 2,3, or 4

d. sum thee digits of the number.

e. if the number is a two digit number, then raise the first digit to the power of the second digit.

f. If the number is a three digit number and the last digit is less than or equal to 4, then raise the first two digits to the powerof the last digit.

After performing an operation if the number is less than 10, add 10 to the number. Also, after each operation determine if the number is prime.

Reference no: EM13763024

Questions Cloud

Eassy on imaginary peripheral device : Come up with an imaginary peripheral device which you think would be useful in personal or business use. Describe what this device would do.
The county medical society answering service : Grace Reed had been working at the County Medical Society Answering Service for 18 months when she received a promotion to shift supervisor. Grace was quite excited. She had worked very hard to develop the technical skills for answering calls and the..
Summarize the relationship between classes and unions : Write a paper in which you summarize the relationship between structures, classes, and unions in object-oriented programming.
What are strategies for reducing behavior problems in class : What are three strategies for reducing and preventing behavior problems in the preschool classroom?
Write a program that uses a random number generator : Write a program that uses a random number generator to generate a two digit positive integer
Significant event relate to the changes on health care : Do you personally agree with the event's significance, based on your beliefs and values?
Improve model by eliminating certain independent variables : Examine the operating earnings regression model output obtained from the 60 stores, as shown in Table 6.27. Try to improve the model by eliminating certain independent variables or by making any other changes that you think make good sense
Compute volcans market value of equity : Compute Volcans's market value of equity before it announces the purchase. Suppose Volcan decides to its internally generated funds to finance the purchase.
Write a program that will calculate number of square feet : write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a program that reads in a single record

Write a program named printRecord.py that reads in a single record from the first logfile, prints it, and exits - Write the final version of your program; it does what merger.py does and then loops through the records accumulating the op costs. It t..

  Pseudocode program by multiplying the length by the width

An area is calculated by multiplying the length by the width. The pseudocode program below shouldask the user for the length and width of a rectangular room in order to calculate the area, and displaythe room's area. Will it do the job.

  Print the list of array of numbers

Print the list of array of numbers and then print linked list with the equivalent character side by side to. output file Specifications:

  Values of variables of logical section of the pseudocode

What are the values of variables a, b, and c after each line of code of each logical section of the pseudocode. Show why the logical section is running.

  Describe array list and its use

Would the ArrayList be better suited for use? Do not just suppose ArrayLists are always used, normal array is still used very often.

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

  Program to find if number input by user is palindrome or not

Write down the program which uses the method called palindrome ( ) to find out if number input by user is a palindrome or not. For instance 1221 is palindrome as it can be read same way forwards and backwards.

  Show tic-tac-toe game scenario diagram

The assignment is not to implement this game in Ruby. Rather, the assignment is to use scenario diagrams to discover the objects, their responsibilities, and the messages they respond to

  Program to input name-weight and price of item

The program must input name and price of item and its weight in pounds and ounces. Then it must determine and display unit price (the price per ounce) of the item.

  Program read data from input file and select specified items

Program should be able to read data from input file and select the specified items. Write data for school-age males to file male.out and data for school-age females to female.out.

  How he sees the future of world englishes and world standard

Discuss how David Crystal’s book is a reaction to the official English movement in the United States. Explain how he constructs an argument about the benefits of multilingualism through the notions of identity and intelligibility

  Explain why competition synchronization is not a problem

Explain clearly why competition synchronization is not a problem in a programming environment that supports coroutines but not concurrency.

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