Computer science homework

profilexx261953122

CS111 Assignment 7


Write a complete C++ program that does the following:


a. Program prompts user to input a positive integer x greater than 1000. If the inputted value is invalid, program continuously prompts user to input a valid number. Program then finds the biggest digit of the x by using biggestDigit function (c). And prints all the prime numbers from 0 to 100 using isPrime function (b).


b. boolean isPrime(int x) tests if a number is a prime number. If the given parameter is prime, then the function returns true; otherwise, it returns false. Prime number is a number that is only divisible by one and itself.


c. int biggestDigit(int x) finds the biggest digit in the given parameter, and returns that value.

    • 8 years ago
    • 5
    Answer(2)

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      screenshot.png
    • attachment
      assignment_7.rar

    Purchase the answer to view it

    blurred-text
    NOT RATED
    • attachment
      screenshot_cplus.jpg
    • attachment
      cplusassignment.zip