Tags:
create new tag
view all tags

Repetition Lab: Factoring: Fall 2026

Learning Objective(s)

  • Learn about event controlled loops (and use a priming read)
  • Statement coverage for testing
  • Enhance overall programming skills

Overview of the Program

Write a program to print the prime factorization of a number

Specifics

  • The program is to be called Factoring
  • The prime factors should be displayed in increasing order
  • A priming read must be used

Sample dialogue

Below is a sample dialogue. The prompts may vary but the input given by the user is to be the same format. Your output can vary somewhat as long as the required data is nicely displayed.
Example 1
What number do you wish to have factored? 120
The prime factorization of 120 is:
2 2 2 3 5 
What number do you wish to have factored? 13
Example 2
The prime factorization of 13 is:
13 
You can also run a solution for this program if you want. See classroom instructions for more details.

Lab Hints

Submission

  • Create a software development report
    • For the system design, you may use my flowchart if it is the design of your program. Otherwise, you need to make your own.
    • For testing report,
      • make sure your tests ensure that each statement is executed at least one.
      • your expected output CANNOT be pasted from the dialogue of a running. Only the actual output may be pasted
      • It should contain two different inputs that are "errors"
    • For the improvement section, specify how many points were lost from the last lab that you should not lose points for on this lab because you corrected the problem
    • create a pdf document from your software development report
    • create an empty zip folder
    • place only Factoring.java and your pdf document into it
    • submit the zip folder on canvas

Optional improvements

Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
  1. Allow the user to type in 2 numbers and print out the prime factors that are shared by both
  2. Call this program Factoring2 add it to the zip folder that contains the original solution.
  3. Add a section to the software development report entitled Extra Credit and explain the logic of your improvement and 2 sets of testing data

Topic attachments
I Attachment History Action SizeSorted descending Date Who Comment
Visio documentvsdx FactoringFlowChart.vsdx r1 manage 38.6 K 2026-06-04 - 17:39 CathyBareiss  
Topic revision: r1 - 2026-06-04 - CathyBareiss
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback