

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The requirements for assignment #4 in cse294a, where students are tasked with building on their previous assignment to determine prime factors and the largest prime number that divides a composite number evenly. Students must display these results, along with the largest integer factor set, and implement these tasks within separate functions.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!
CSE294A Assignment # Professor Miller 1/
CSE294A Assignment # 1.5% of course grade
This assignment is going to give you experience using functions and adding some logic to your previous program.
For this project, you will build on your Assignment #3, which was to determine whether a number was prime or composite. In Assignment #3, you also printed out the largest
number that divided a composite number evenly. For this assignment, you will display
some additional information for composite numbers to the user.
First of all, you need to display not only the largest integer that divides a composite
number evenly, but you also need to display the largest prime number that divides the composite number evenly.
Second, you will display the set of prime factors for a composite value. Every number can be written as the product of a series of prime numbers. Your task here is to display
the set of prime numbers that can be multiplied together to equal the composite value
entered by the user.
Third, there are many sets of values that will multiply to equal a composite number. You will display one of the sets that contain the largest integer less than the composite
number.
All of the requirements from Assignment #3 still must be met for this assignment. In
addition, each of the three tasks that you have in this assignment must be contained
within separate functions. That means that you must have at least three additional functions in this program. If you would like to add more, feel free.
Note also that you must make your output look exactly the same as mine. Imagine this is a document from a job, and you must implement the requirements exactly as
documented.
Here are some examples.
Please enter a positive integer: 10 COMPOSITE Largest number that divides 10 evenly is 5 Largest prime number that divides 10 evenly is 5 Prime factors = 2 * 5 Largest integer factor set = 2 * 5
Please enter a positive integer: 7 PRIME
CSE294A Assignment # Professor Miller 2/
Please enter a positive integer: a a is not a positive integer.
Please enter a positive integer: 93 COMPOSITE Largest number that divides 93 evenly is 31 Largest prime number that divides 10 evenly is 31 Prime factors = 3 * 31 Largest integer factor set = 3 * 31
Please enter a positive integer: 101 PRIME
Please enter a positive integer: 90 COMPOSITE Largest number that divides 90 evenly is 45 Largest prime number that divides 90 evenly is 5 Prime factors = 2 * 3 * 3 * 5 Largest integer factor set = 2 * 45
Please enter a positive integer: q Thank you for using my program.
Grading Criteria 0.3% displaying largest prime number that divides composite value evenly 0.3% displaying prime factors of a composite value 0.3% displaying largest integer factor set of a composite value 0.6% using at least three additional functions